diff --git a/sdk/servicebus/service-bus/src/serviceBusClient.ts b/sdk/servicebus/service-bus/src/serviceBusClient.ts index 002c34c9150c..c0cc55577610 100644 --- a/sdk/servicebus/service-bus/src/serviceBusClient.ts +++ b/sdk/servicebus/service-bus/src/serviceBusClient.ts @@ -79,25 +79,53 @@ 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. + * + * 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. + * + * More information about how peekLock and message settlement works here: + * https://docs.microsoft.com/en-us/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock * * @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; /** - * 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; /** - * 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. + * + * More information about how peekLock and message settlement works here: + * https://docs.microsoft.com/en-us/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock * * @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, @@ -105,11 +133,13 @@ export class ServiceBusClient { receiveMode: "peekLock" ): Receiver; /** - * 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, @@ -152,10 +182,23 @@ export class ServiceBusClient { } /** - * Creates a receiver for an Azure Service Bus queue. + * Creates a receiver for a session enabled Azure Service Bus queue in peekLock mode. + * + * 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. + * + * More information about how peekLock and message settlement works here: + * https://docs.microsoft.com/en-us/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock * * @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( @@ -164,10 +207,12 @@ export class ServiceBusClient { options?: CreateSessionReceiverOptions ): Promise>; /** - * Creates a receiver for an Azure Service Bus queue. + * Creates a receiver for a session enabled 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( @@ -176,11 +221,24 @@ export class ServiceBusClient { options?: CreateSessionReceiverOptions ): Promise>; /** - * Creates a receiver for an Azure Service Bus subscription. + * Creates a receiver for a session enabled 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. + * + * More information about how peekLock and message settlement works here: + * https://docs.microsoft.com/en-us/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock * * @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( @@ -190,11 +248,13 @@ export class ServiceBusClient { options?: CreateSessionReceiverOptions ): Promise>; /** - * Creates a receiver for an Azure Service Bus subscription. + * Creates a receiver for a session enabled 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( @@ -271,31 +331,63 @@ 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. + * + * See here for more information about dead letter queues: + * https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-dead-letter-queues + * + * More information about how peekLock and message settlement works here: + * https://docs.microsoft.com/en-us/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock * * @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; /** - * 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. + * + * See here for more information about dead letter queues: + * https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-dead-letter-queues * * @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; /** - * 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. + * + * See here for more information about dead letter queues: + * https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-dead-letter-queues + * + * More information about how peekLock and message settlement works here: + * https://docs.microsoft.com/en-us/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock * * @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, @@ -303,11 +395,16 @@ export class ServiceBusClient { receiveMode: "peekLock" ): Receiver; /** - * 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. + * + * See here for more information about dead letter queues: + * https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-dead-letter-queues * * @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,