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] Improve doc strings for create() methods on ServiceBusClient #8778

Merged
115 changes: 91 additions & 24 deletions sdk/servicebus/service-bus/src/serviceBusClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,37 +79,61 @@ export class ServiceBusClient {
}

/**
* Creates a receiver for an Azure Service Bus queue.
* Creates a receiver for an Azure Service Bus queue in peekLock mode.
*
* In peekLock mode, the receiver has a lock on the message for the duration specified on the
* queue.
ramya-rao-a marked this conversation as resolved.
Show resolved Hide resolved
*
* Messages that are not settled within the lock duration will be redelivered as many times as
* the max delivery count set on the queue, after which they get sent to a separate dead letter
* queue.
*
* You can settle a message by calling complete(), abandon(), defer() or deadletter() methods on
* the message.
ramya-rao-a marked this conversation as resolved.
Show resolved Hide resolved
richardpark-msft marked this conversation as resolved.
Show resolved Hide resolved
*
* @param queueName The name of the queue to receive from.
* @param receiveMode The receive mode to use (defaults to PeekLock)
* @param receiveMode The receive mode, defaulted to peekLock.
*/
createReceiver(queueName: string, receiveMode: "peekLock"): Receiver<ReceivedMessageWithLock>;
/**
* Creates a receiver for an Azure Service Bus queue.
* Creates a receiver for an Azure Service Bus queue in receiveAndDelete mode.
*
* In receiveAndDelete mode, messages are deleted from Service Bus as they are received.
*
* @param queueName The name of the queue to receive from.
* @param receiveMode The receive mode to use (defaults to PeekLock)
* @param receiveMode The receive mode, defaulted to receiveAndDelete.
*/
createReceiver(queueName: string, receiveMode: "receiveAndDelete"): Receiver<ReceivedMessage>;
/**
* Creates a receiver for an Azure Service Bus subscription.
* Creates a receiver for an Azure Service Bus subscription in peekLock mode.
*
* In peekLock mode, the receiver has a lock on the message for the duration specified on the
* subscription.
*
* Messages that are not settled within the lock duration will be redelivered as many times as
* the max delivery count set on the subscription, after which they get sent to a separate dead letter
* queue.
*
* You can settle a message by calling complete(), abandon(), defer() or deadletter() methods on
* the message.
*
* @param topicName Name of the topic for the subscription we want to receive from.
* @param subscriptionName Name of the subscription (under the `topic`) that we want to receive from.
* @param receiveMode The receive mode to use (defaults to PeekLock)
* @param receiveMode The receive mode, defaulted to peekLock.
*/
createReceiver(
topicName: string,
subscriptionName: string,
receiveMode: "peekLock"
): Receiver<ReceivedMessageWithLock>;
/**
* Creates a receiver for an Azure Service Bus subscription.
* Creates a receiver for an Azure Service Bus subscription in receiveAndDelete mode.
*
* In receiveAndDelete mode, messages are deleted from Service Bus as they are received.
*
* @param topicName Name of the topic for the subscription we want to receive from.
* @param subscriptionName Name of the subscription (under the `topic`) that we want to receive from.
* @param receiveMode The receive mode to use (defaults to PeekLock)
* @param receiveMode The receive mode, defaulted to receiveAndDelete.
*/
createReceiver(
topicName: string,
Expand Down Expand Up @@ -152,10 +176,20 @@ export class ServiceBusClient {
}

/**
* Creates a receiver for an Azure Service Bus queue.
* Creates a receiver for an Azure Service Bus queue in peekLock mode.
richardpark-msft marked this conversation as resolved.
Show resolved Hide resolved
*
* In peekLock mode, the receiver has a lock on the session for the duration specified on the
* queue.
*
* Messages that are not settled within the lock duration will be redelivered as many times as
* the max delivery count set on the queue, after which they get sent to a separate dead letter
* queue.
*
* You can settle a message by calling complete(), abandon(), defer() or deadletter() methods on
* the message.
*
* @param queueName The name of the queue to receive from.
* @param receiveMode The receive mode to use (defaults to PeekLock)
* @param receiveMode The receive mode, defaulted to peekLock.
* @param options Options for the receiver itself.
*/
createSessionReceiver(
Expand All @@ -164,10 +198,12 @@ export class ServiceBusClient {
options?: CreateSessionReceiverOptions
): Promise<SessionReceiver<ReceivedMessageWithLock>>;
/**
* Creates a receiver for an Azure Service Bus queue.
* Creates a receiver for an Azure Service Bus queue in receiveAndDelete mode.
*
* In receiveAndDelete mode, messages are deleted from Service Bus as they are received.
*
* @param queueName The name of the queue to receive from.
* @param receiveMode The receive mode to use (defaults to PeekLock)
* @param receiveMode The receive mode, defaulted to receiveAndDelete.
* @param options Options for the receiver itself.
*/
createSessionReceiver(
Expand All @@ -176,11 +212,21 @@ export class ServiceBusClient {
options?: CreateSessionReceiverOptions
): Promise<SessionReceiver<ReceivedMessage>>;
/**
* Creates a receiver for an Azure Service Bus subscription.
* Creates a receiver for an Azure Service Bus subscription in peekLock mode.
*
* In peekLock mode, the receiver has a lock on the session for the duration specified on the
* subscription.
*
* Messages that are not settled within the lock duration will be redelivered as many times as
* the max delivery count set on the subscription, after which they get sent to a separate dead letter
* queue.
*
* You can settle a message by calling complete(), abandon(), defer() or deadletter() methods on
* the message.
*
* @param topicName Name of the topic for the subscription we want to receive from.
* @param subscriptionName Name of the subscription (under the `topic`) that we want to receive from.
* @param receiveMode The receive mode to use (defaults to PeekLock)
* @param receiveMode The receive mode, defaulted to peekLock.
* @param options Options for the receiver itself.
*/
createSessionReceiver(
Expand All @@ -190,11 +236,13 @@ export class ServiceBusClient {
options?: CreateSessionReceiverOptions
): Promise<SessionReceiver<ReceivedMessageWithLock>>;
/**
* Creates a receiver for an Azure Service Bus subscription.
* Creates a receiver for an Azure Service Bus subscription in receiveAndDelete mode.
*
* In receiveAndDelete mode, messages are deleted from Service Bus as they are received.
*
* @param topicName Name of the topic for the subscription we want to receive from.
* @param subscriptionName Name of the subscription (under the `topic`) that we want to receive from.
* @param receiveMode The receive mode to use (defaults to PeekLock)
* @param receiveMode The receive mode, defaulted to receiveAndDelete.
* @param options Options for the receiver itself.
*/
createSessionReceiver(
Expand Down Expand Up @@ -271,43 +319,62 @@ export class ServiceBusClient {
// }

/**
* Creates a receiver for an Azure Service Bus queue's dead letter queue.
* Creates a receiver for an Azure Service Bus queue's dead letter queue in peekLock mode.
*
* In peekLock mode, the receiver has a lock on the message for the duration specified on the
* queue.
*
* In peekLock mode, the receiver has a lock on the message for the duration specified on the
* queue. Messages that are not settled within the lock duration will be redelivered.
*
* You can settle a message by calling complete(), abandon() or defer() methods on
* the message.
*
* @param queueName The name of the queue to receive from.
* @param receiveMode The receive mode to use (defaults to PeekLock)
* @param receiveMode The receive mode, defaulted to peekLock.
*/
createDeadLetterReceiver(
queueName: string,
receiveMode: "peekLock"
): Receiver<ReceivedMessageWithLock>;
/**
* Creates a receiver for an Azure Service Bus queue's dead letter queue.
* Creates a receiver for an Azure Service Bus queue's dead letter queue in receiveAndDelete mode.
*
* In receiveAndDelete mode, messages are deleted from Service Bus as they are received.
*
* @param queueName The name of the queue to receive from.
* @param receiveMode The receive mode to use (defaults to PeekLock)
* @param receiveMode The receive mode, defaulted to receiveAndDelete.
*/
createDeadLetterReceiver(
queueName: string,
receiveMode: "receiveAndDelete"
): Receiver<ReceivedMessage>;
/**
* Creates a receiver for an Azure Service Bus subscription's dead letter queue.
* Creates a receiver for an Azure Service Bus subscription's dead letter queue in peekLock mode.
*
* In peekLock mode, the receiver has a lock on the message for the duration specified on the
* subscription. Messages that are not settled within the lock duration will be redelivered.
*
* You can settle a message by calling complete(), abandon() or defer() methods on
* the message.
*
* @param topicName Name of the topic for the subscription we want to receive from.
* @param subscriptionName Name of the subscription (under the `topic`) that we want to receive from.
* @param receiveMode The receive mode to use (defaults to PeekLock)
* @param receiveMode The receive mode, defaulted to peekLock.
*/
createDeadLetterReceiver(
topicName: string,
subscriptionName: string,
receiveMode: "peekLock"
): Receiver<ReceivedMessageWithLock>;
/**
* Creates a receiver for an Azure Service Bus subscription's dead letter queue.
* Creates a receiver for an Azure Service Bus subscription's dead letter queue in receiveAndDelete mode.
*
* In receiveAndDelete mode, messages are deleted from Service Bus as they are received.
*
* @param topicName Name of the topic for the subscription we want to receive from.
* @param subscriptionName Name of the subscription (under the `topic`) that we want to receive from.
* @param receiveMode The receive mode to use (defaults to PeekLock)
* @param receiveMode The receive mode, defaulted to receiveAndDelete.
*/
createDeadLetterReceiver(
topicName: string,
Expand Down