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] Add workaround for scheduleMessage method in the docs #6983

Merged
3 changes: 2 additions & 1 deletion sdk/servicebus/service-bus/CHANGELOG.md
@@ -1,9 +1,10 @@
# Release History

## 1.1.3
## 1.1.3 (#Unreleased)

- Fixes issue where the promise returned by `receiveMessages` would sometimes fail to settle when the underlying connection
was disconnected while receiving messages.
- Workaround for the [bug 6816](https://github.com/Azure/azure-sdk-for-js/issues/6816) affecting messages sent using the `scheduleMessage()` and `scheduleMessages()` methods has been added to the docs - [PR 6983](https://github.com/Azure/azure-sdk-for-js/pull/6983))

## 1.1.2 (2019-12-12)

Expand Down
3 changes: 3 additions & 0 deletions sdk/servicebus/service-bus/review/service-bus.api.md
Expand Up @@ -7,6 +7,7 @@
import { AmqpMessage } from '@azure/amqp-common';
import { ApplicationTokenCredentials } from '@azure/ms-rest-nodeauth';
import { DataTransformer } from '@azure/amqp-common';
import { DefaultDataTransformer } from '@azure/amqp-common';
import { delay } from '@azure/amqp-common';
import { Delivery } from 'rhea-promise';
import { DeviceTokenCredentials } from '@azure/ms-rest-nodeauth';
Expand Down Expand Up @@ -75,6 +76,8 @@ export interface DeadLetterOptions {
deadletterReason: string;
}

export { DefaultDataTransformer }

export { delay }

// @public
Expand Down
1 change: 1 addition & 0 deletions sdk/servicebus/service-bus/src/index.ts
Expand Up @@ -9,6 +9,7 @@ export {
TokenInfo,
TokenType,
TokenProvider,
DefaultDataTransformer,
DataTransformer,
delay,
MessagingError
Expand Down
24 changes: 23 additions & 1 deletion sdk/servicebus/service-bus/src/sender.ts
Expand Up @@ -106,7 +106,18 @@ export class Sender {
}

/**
* Schedules given message to appear on Service Bus Queue/Subscription at a later time.
* Schedules given messages to appear on Service Bus Queue/Subscription at a later time.
HarshaNalluru marked this conversation as resolved.
Show resolved Hide resolved
*
* Please note that you need to explicitly encode the message body if you intend to receive the message using a tool or library other than this library.
* For example:
* 1. Import DefaultDataTransformer and instantiate.
* ```js
* const dt = new DefaultDataTransformer();
* ```
* 2. Use the `encode` method on the transformer to encode the message body before calling the scheduleMessage() method
* ```js
* message.body = dt.encode(message.body);
* ```
*
* @param scheduledEnqueueTimeUtc - The UTC time at which the message should be enqueued.
* @param message - The message that needs to be scheduled.
Expand Down Expand Up @@ -140,6 +151,17 @@ export class Sender {
/**
* Schedules given messages to appear on Service Bus Queue/Subscription at a later time.
*
* Please note that you need to explicitly encode the message body if you intend to receive the message using a tool or library other than this library.
* For example:
* 1. Import DefaultDataTransformer and instantiate.
* ```js
* const dt = new DefaultDataTransformer();
* ```
* 2. Use the `encode` method on the transformer to encode the message body before calling the scheduleMessage() method
* ```js
* message.body = dt.encode(message.body);
* ```
*
* @param scheduledEnqueueTimeUtc - The UTC time at which the messages should be enqueued.
* @param messages - Array of Messages that need to be scheduled.
* @returns Promise<Long[]> - The sequence numbers of messages that were scheduled.
Expand Down