Skip to content

Commit

Permalink
[Service Bus] Move scheduledMessageCount to TopicRuntimeProps from Su…
Browse files Browse the repository at this point in the history
…bscriptionRuntimeProps (#10250)

* Move scheduledMessageCount to TopicRuntimeProps

* fis tests

* remove the magic type for readability
  • Loading branch information
HarshaNalluru authored Jul 28, 2020
1 parent 821f350 commit a91e5fc
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion sdk/servicebus/service-bus/review/service-bus.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,6 @@ export interface SubscriptionRuntimeProperties {
activeMessageCount: number;
createdAt: Date;
deadLetterMessageCount: number;
scheduledMessageCount: number;
subscriptionName: string;
topicName: string;
totalMessageCount: number;
Expand Down Expand Up @@ -467,6 +466,7 @@ export interface TopicRuntimeProperties {
accessedAt: Date;
createdAt: Date;
name: string;
scheduledMessageCount: number;
sizeInBytes?: number;
subscriptionCount?: number;
updatedAt: Date;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ export function buildSubscriptionRuntimeProperties(
subscriptionName: getString(rawSubscription[Constants.SUBSCRIPTION_NAME], "subscriptionName"),
topicName: getString(rawSubscription[Constants.TOPIC_NAME], "topicName"),
totalMessageCount: getInteger(rawSubscription[Constants.MESSAGE_COUNT], "messageCount"),
...messageCountDetails,
activeMessageCount: messageCountDetails.activeMessageCount,
deadLetterMessageCount: messageCountDetails.deadLetterMessageCount,
transferDeadLetterMessageCount: messageCountDetails.transferDeadLetterMessageCount,
transferMessageCount: messageCountDetails.transferMessageCount,
createdAt: getDate(rawSubscription[Constants.CREATED_AT], "createdAt"),
updatedAt: getDate(rawSubscription[Constants.UPDATED_AT], "updatedAt"),
accessedAt: getDate(rawSubscription[Constants.ACCESSED_AT], "accessedAt")
Expand Down Expand Up @@ -361,11 +364,6 @@ export interface SubscriptionRuntimeProperties {
*/
deadLetterMessageCount: number;

/**
* The number of scheduled messages.
*/
scheduledMessageCount: number;

/**
* The number of messages transferred to another queue, topic, or subscription
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import {
getRawAuthorizationRules,
getString,
getStringOrUndefined,
getDate
getDate,
getMessageCountDetails
} from "../util/utils";

/**
Expand Down Expand Up @@ -99,6 +100,8 @@ export function buildTopicRuntimeProperties(rawTopic: any): TopicRuntimeProperti
sizeInBytes: getIntegerOrUndefined(rawTopic[Constants.SIZE_IN_BYTES]),
subscriptionCount: getIntegerOrUndefined(rawTopic[Constants.SUBSCRIPTION_COUNT]),
createdAt: getDate(rawTopic[Constants.CREATED_AT], "createdAt"),
scheduledMessageCount: getMessageCountDetails(rawTopic[Constants.COUNT_DETAILS])
.scheduledMessageCount,
updatedAt: getDate(rawTopic[Constants.UPDATED_AT], "updatedAt"),
accessedAt: getDate(rawTopic[Constants.ACCESSED_AT], "accessedAt")
};
Expand Down Expand Up @@ -302,6 +305,11 @@ export interface TopicRuntimeProperties {
*/
subscriptionCount?: number;

/**
* The number of scheduled messages.
*/
scheduledMessageCount: number;

/**
* Created at timestamp
*/
Expand Down
6 changes: 3 additions & 3 deletions sdk/servicebus/service-bus/test/atomManagement.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ describe("Atom management - Authentication", function(): void {
output: {
sizeInBytes: 0,
subscriptionCount: 0,
scheduledMessageCount: 0,
name: managementTopic1
}
},
Expand All @@ -542,7 +543,6 @@ describe("Atom management - Authentication", function(): void {
totalMessageCount: 0,
activeMessageCount: 0,
deadLetterMessageCount: 0,
scheduledMessageCount: 0,
transferMessageCount: 0,
transferDeadLetterMessageCount: 0,
topicName: managementTopic1,
Expand Down Expand Up @@ -645,6 +645,7 @@ describe("Atom management - Authentication", function(): void {
output: {
sizeInBytes: 0,
subscriptionCount: 0,
scheduledMessageCount: 0,
name: managementTopic1
}
},
Expand All @@ -653,6 +654,7 @@ describe("Atom management - Authentication", function(): void {
output: {
sizeInBytes: 0,
subscriptionCount: 0,
scheduledMessageCount: 0,
name: managementTopic2
}
}
Expand All @@ -665,7 +667,6 @@ describe("Atom management - Authentication", function(): void {
totalMessageCount: 0,
activeMessageCount: 0,
deadLetterMessageCount: 0,
scheduledMessageCount: 0,
transferMessageCount: 0,
transferDeadLetterMessageCount: 0,
topicName: managementTopic1,
Expand All @@ -678,7 +679,6 @@ describe("Atom management - Authentication", function(): void {
totalMessageCount: 0,
activeMessageCount: 0,
deadLetterMessageCount: 0,
scheduledMessageCount: 0,
transferMessageCount: 0,
transferDeadLetterMessageCount: 0,
topicName: managementTopic1,
Expand Down

0 comments on commit a91e5fc

Please sign in to comment.