Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Service Bus] Support MaxMessageSizeInKilobytes #17953

Merged
merged 30 commits into from
Oct 1, 2021
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b7a15ca
Fix retry handling for Session Not Found errors
southpolesteve Aug 23, 2021
ca193b8
Update sdk/cosmosdb/cosmos/test/internal/session.spec.ts
southpolesteve Aug 23, 2021
4b1a28d
Update CODEOWNERS for Application Insights (#17055)
omziv Aug 25, 2021
ac74691
MaxMessageSizeInKilobytes api
HarshaNalluru Sep 28, 2021
5a3f61f
sample,test.env
HarshaNalluru Sep 29, 2021
ab38a7f
API Report
HarshaNalluru Sep 29, 2021
a92b562
add tests
HarshaNalluru Sep 29, 2021
c7216a3
finish the tests
HarshaNalluru Sep 29, 2021
877e520
remove console.log
HarshaNalluru Sep 29, 2021
5ae1497
arm template
HarshaNalluru Sep 29, 2021
33c7a51
put .only to test in CI with limited tests
HarshaNalluru Sep 29, 2021
f591f89
minor test update
HarshaNalluru Sep 29, 2021
d3a1972
remove .only, add changelog
HarshaNalluru Sep 29, 2021
a484888
Update sdk/servicebus/service-bus/src/util/constants.ts
HarshaNalluru Sep 29, 2021
3d44649
Merge branch 'harshan/sb/isssue/17592' of https://github.com/harshana…
HarshaNalluru Sep 29, 2021
6ffc5c5
wrap text - changelog
HarshaNalluru Sep 29, 2021
4f42563
maxMessageSizeInKilobytes: 256 by default for Standard namespaces
HarshaNalluru Sep 30, 2021
f0039e0
Revert "maxMessageSizeInKilobytes: 256 by default for Standard namesp…
HarshaNalluru Sep 30, 2021
1233921
exclude "maxMessageSizeInKilobytes"
HarshaNalluru Sep 30, 2021
f312390
(Configurable only for Premium Tier Service Bus namespace.)
HarshaNalluru Sep 30, 2021
1a90e13
Version 7.3.1-beta.1
HarshaNalluru Sep 30, 2021
e903476
update version at more places
HarshaNalluru Sep 30, 2021
83c6be2
lock file
HarshaNalluru Sep 30, 2021
393a3b9
Update sdk/servicebus/service-bus/CHANGELOG.md
HarshaNalluru Sep 30, 2021
8b5b21b
dummy
HarshaNalluru Sep 30, 2021
4dcc280
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-js into…
HarshaNalluru Sep 30, 2021
16a56b9
lock file
HarshaNalluru Sep 30, 2021
d8eccca
Merge branch 'harshan/sb/isssue/17592' of https://github.com/harshana…
HarshaNalluru Sep 30, 2021
b73e9cb
non optional in EntityProperties
HarshaNalluru Sep 30, 2021
70b8d32
api report
HarshaNalluru Sep 30, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 45 additions & 2 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion sdk/servicebus/service-bus/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Release History

## 7.3.1 (Unreleased)
## 7.3.1-beta.1 (Unreleased)

### Features Added

- Adds new get/set property `maxMessageSizeInKilobytes` to `QueueProperties`, `TopicProperties`, `CreateQueueOptions`, and `CreateTopicOptions`. Only applicable for premium namespaces. Use this when creating or updating queues and topics. Added in [#17953](https://github.com/Azure/azure-sdk-for-js/pull/17953)

### Breaking Changes

### Bugs Fixed
Expand Down
2 changes: 1 addition & 1 deletion sdk/servicebus/service-bus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@azure/service-bus",
"sdk-type": "client",
"author": "Microsoft Corporation",
"version": "7.3.1",
"version": "7.3.1-beta.1",
"license": "MIT",
"description": "Azure Service Bus SDK for JavaScript",
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/servicebus/service-bus/",
Expand Down
4 changes: 4 additions & 0 deletions sdk/servicebus/service-bus/review/service-bus.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export interface CreateQueueOptions extends OperationOptions {
forwardTo?: string;
lockDuration?: string;
maxDeliveryCount?: number;
maxMessageSizeInKilobytes?: number;
maxSizeInMegabytes?: number;
requiresDuplicateDetection?: boolean;
requiresSession?: boolean;
Expand Down Expand Up @@ -113,6 +114,7 @@ export interface CreateTopicOptions extends OperationOptions {
enableBatchedOperations?: boolean;
enableExpress?: boolean;
enablePartitioning?: boolean;
maxMessageSizeInKilobytes?: number;
maxSizeInMegabytes?: number;
requiresDuplicateDetection?: boolean;
status?: EntityStatus;
Expand Down Expand Up @@ -199,6 +201,7 @@ export interface QueueProperties {
forwardTo?: string;
lockDuration: string;
maxDeliveryCount: number;
maxMessageSizeInKilobytes?: number;
maxSizeInMegabytes: number;
readonly name: string;
readonly requiresDuplicateDetection: boolean;
Expand Down Expand Up @@ -551,6 +554,7 @@ export interface TopicProperties {
enableBatchedOperations: boolean;
readonly enableExpress: boolean;
readonly enablePartitioning: boolean;
maxMessageSizeInKilobytes?: number;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is always populated (as indicated in one of the comments), should it be nullable?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, will update

maxSizeInMegabytes: number;
readonly name: string;
readonly requiresDuplicateDetection: boolean;
Expand Down
4 changes: 2 additions & 2 deletions sdk/servicebus/service-bus/sample.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Used in most samples. Retrieve these values from a storage account in the Azure Portal.
# Used in most samples. Retrieve these values from a service-bus namespace in the Azure Portal.
SERVICEBUS_ENDPOINT="<service bus namespace>.servicebus.windows.net"
SERVICEBUS_CONNECTION_STRING="<connection string>"

Expand All @@ -23,4 +23,4 @@ AZURE_CLIENT_ID=<ID of the user/service principal to authenticate as>
AZURE_CLIENT_SECRET=<client secret used to authenticate to Azure AD>

# To run the useProxy sample, set up an HTTP proxy and enter your information:
# HTTP_PROXY=http://localhost:3128
# HTTP_PROXY=http://localhost:3128
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ export function buildQueueOptions(queue: CreateQueueOptions): InternalQueueOptio
EnablePartitioning: getStringOrUndefined(queue.enablePartitioning),
ForwardDeadLetteredMessagesTo: getStringOrUndefined(queue.forwardDeadLetteredMessagesTo),
EntityAvailabilityStatus: getStringOrUndefined(queue.availabilityStatus),
EnableExpress: getStringOrUndefined(queue.enableExpress)
EnableExpress: getStringOrUndefined(queue.enableExpress),
MaxMessageSizeInKilobytes: getStringOrUndefined(queue.maxMessageSizeInKilobytes)
};
}

Expand Down Expand Up @@ -111,7 +112,12 @@ export function buildQueue(rawQueue: Record<string, any>): QueueProperties {

enableExpress: getBoolean(rawQueue[Constants.ENABLE_EXPRESS], "enableExpress"),

availabilityStatus: rawQueue[Constants.ENTITY_AVAILABILITY_STATUS]
availabilityStatus: rawQueue[Constants.ENTITY_AVAILABILITY_STATUS],

maxMessageSizeInKilobytes: getInteger(
rawQueue[Constants.MAX_MESSAGE_SIZE_IN_KILOBYTES],
"maxMessageSizeInKilobytes"
)
};
}

Expand Down Expand Up @@ -156,6 +162,13 @@ export interface CreateQueueOptions extends OperationOptions {
*/
maxSizeInMegabytes?: number;

/**
* The maximum message size in kilobytes for messages sent to this queue.
*
* (Configurable only for Premium Tier Service Bus namespace.)
*/
maxMessageSizeInKilobytes?: number;

/**
* If enabled, the topic will detect duplicate messages within the time
* span specified by the DuplicateDetectionHistoryTimeWindow property.
Expand Down Expand Up @@ -299,6 +312,11 @@ export interface QueueProperties {
*/
maxSizeInMegabytes: number;

/**
* The maximum message size in kilobytes for messages sent to this queue.
*/
maxMessageSizeInKilobytes?: number;

/**
* If enabled, the topic will detect duplicate messages within the time
* span specified by the DuplicateDetectionHistoryTimeWindow property.
Expand Down Expand Up @@ -436,6 +454,11 @@ export interface InternalQueueOptions {
*/
MaxSizeInMegabytes?: string;

/**
* The maximum message size in kilobytes for messages sent to this queue/topic.
*/
MaxMessageSizeInKilobytes?: string;

/**
* If enabled, the topic will detect duplicate messages within the time
* span specified by the DuplicateDetectionHistoryTimeWindow property.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ export function buildTopicOptions(topic: CreateTopicOptions): InternalTopicOptio
AutoDeleteOnIdle: getStringOrUndefined(topic.autoDeleteOnIdle),
EnablePartitioning: getStringOrUndefined(topic.enablePartitioning),
EntityAvailabilityStatus: getStringOrUndefined(topic.availabilityStatus),
EnableExpress: getStringOrUndefined(topic.enableExpress)
EnableExpress: getStringOrUndefined(topic.enableExpress),
MaxMessageSizeInKilobytes: getStringOrUndefined(topic.maxMessageSizeInKilobytes)
};
}

Expand Down Expand Up @@ -93,7 +94,12 @@ export function buildTopic(rawTopic: Record<string, any>): TopicProperties {

enableExpress: getBoolean(rawTopic[Constants.ENABLE_EXPRESS], "enableExpress"),

availabilityStatus: rawTopic[Constants.ENTITY_AVAILABILITY_STATUS]
availabilityStatus: rawTopic[Constants.ENTITY_AVAILABILITY_STATUS],

maxMessageSizeInKilobytes: getInteger(
rawTopic[Constants.MAX_MESSAGE_SIZE_IN_KILOBYTES],
"maxMessageSizeInKilobytes"
)
};
}

Expand Down Expand Up @@ -142,6 +148,13 @@ export interface CreateTopicOptions extends OperationOptions {
*/
maxSizeInMegabytes?: number;

/**
* The maximum message size in kilobytes for messages sent to this topic.
*
* (Configurable only for Premium Tier Service Bus namespace.)
*/
maxMessageSizeInKilobytes?: number;

/**
* If enabled, the topic will detect duplicate messages within the time span
* specified by the DuplicateDetectionHistoryTimeWindow property.
Expand Down Expand Up @@ -243,6 +256,11 @@ export interface TopicProperties {
*/
maxSizeInMegabytes: number;

/**
* The maximum message size in kilobytes for messages sent to this queue/topic.
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add the note about being configurable only for Premium and service version 2021-05 or higher for each property?

Copy link
Member Author

@HarshaNalluru HarshaNalluru Sep 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added that note("configurable only for Premium") for the Create{Entity}Options interfaces.
Did not add the same for {Entity}Properties interface as that is used for output responses.

service version 2021-05 or higher

How does it matter if the users can't configure the service version?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The users can't configure the service version?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like it should be configurable based on the TS guidelines - https://azure.github.io/azure-sdk/typescript_design.html#ts-service-versions-select-api-version

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.

Should I add this in a future PR, @ramya-rao-a?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't we need to do this before releasing a new service version?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a scenario where the customer would want to intentionally use the older API version? If so, then we can make sure we allow that before GA

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we recommend that libraries that use the SDK pin to a specific API version. So we should probably support that before GA.

maxMessageSizeInKilobytes?: number;

/**
* If enabled, the topic will detect duplicate messages within the time span
* specified by the DuplicateDetectionHistoryTimeWindow property.
Expand Down Expand Up @@ -339,6 +357,12 @@ export interface InternalTopicOptions {
*/
MaxSizeInMegabytes?: string;

/**
* The maximum message size in kilobytes for messages sent to this queue/topic
*
*/
MaxMessageSizeInKilobytes?: string;

/**
* If enabled, the topic will detect duplicate messages within the time span
* specified by the DuplicateDetectionHistoryTimeWindow property.
Expand Down
11 changes: 8 additions & 3 deletions sdk/servicebus/service-bus/src/util/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
export const packageJsonInfo = {
name: "@azure/service-bus",
version: "7.3.1"
version: "7.3.1-beta.1"
};

/**
Expand Down Expand Up @@ -172,7 +172,12 @@ export const USER_METADATA = "UserMetadata";
* @internal
*/
export const MAX_SIZE_IN_MEGABYTES = "MaxSizeInMegabytes";

/**
* The maximum size in kilobytes.
*
* @internal
*/
export const MAX_MESSAGE_SIZE_IN_KILOBYTES = "MaxMessageSizeInKilobytes";
/**
* The default message time to live.
* This is specified in ISO-8601 duration format such as "PT1M" for 1 minute, "PT5S" for 5 seconds.
Expand Down Expand Up @@ -273,7 +278,7 @@ export const API_VERSION_QUERY_KEY = "api-version";
*
* @internal
*/
export const CURRENT_API_VERSION = "2017-04";
export const CURRENT_API_VERSION = "2021-05";

/**
* Constant representing the Odata Error 'message' property
Expand Down
10 changes: 10 additions & 0 deletions sdk/servicebus/service-bus/test.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Used in most tests. Retrieve this value from a service-bus namespace in the Azure Portal.
SERVICEBUS_CONNECTION_STRING="<connection string>"

# Used in a couple of tests
SERVICEBUS_CONNECTION_STRING_PREMIUM="<connection string>"

# Used to authenticate using Azure AD as a service principal for role-based authentication.
AZURE_TENANT_ID=<AD tenant id or name>
AZURE_CLIENT_ID=<ID of the user/service principal to authenticate as>
AZURE_CLIENT_SECRET=<client secret used to authenticate to Azure AD>
Loading