Skip to content

Commit

Permalink
Remove receiver overloads meant to hide settlement methods when using…
Browse files Browse the repository at this point in the history
… ReceiveAndDelete mode (Azure#12014)
  • Loading branch information
ramya-rao-a authored Oct 23, 2020
1 parent 0bc0c6c commit 433905b
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 244 deletions.
1 change: 1 addition & 0 deletions sdk/servicebus/service-bus/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

### Breaking changes

- The methods to complete, abandon, defer and deadletter a message along with the method to renew message lock have been moved from the message to the receiver.
- The `createBatch` method on the sender is renamed to `createMessageBatch`.
- The interface `CreateBatchOptions` followed by the options that are passed to the `createBatch` method is renamed to `CreateMessageBatchOptions`.
- The `tryAdd` method on the message batch object is renamed to `tryAddMessage`.
Expand Down
26 changes: 10 additions & 16 deletions sdk/servicebus/service-bus/review/service-bus.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,19 +312,13 @@ export class ServiceBusAdministrationClient extends ServiceClient {
export class ServiceBusClient {
constructor(connectionString: string, options?: ServiceBusClientOptions);
constructor(fullyQualifiedNamespace: string, credential: TokenCredential, options?: ServiceBusClientOptions);
acceptNextSession(queueName: string, options?: ServiceBusSessionReceiverOptions<"peekLock">): Promise<ServiceBusSessionReceiver>;
acceptNextSession(queueName: string, options: ServiceBusSessionReceiverOptions<"receiveAndDelete">): Promise<ServiceBusSessionReceiver>;
acceptNextSession(topicName: string, subscriptionName: string, options?: ServiceBusSessionReceiverOptions<"peekLock">): Promise<ServiceBusSessionReceiver>;
acceptNextSession(topicName: string, subscriptionName: string, options: ServiceBusSessionReceiverOptions<"receiveAndDelete">): Promise<ServiceBusSessionReceiver>;
acceptSession(queueName: string, sessionId: string, options?: ServiceBusSessionReceiverOptions<"peekLock">): Promise<ServiceBusSessionReceiver>;
acceptSession(queueName: string, sessionId: string, options: ServiceBusSessionReceiverOptions<"receiveAndDelete">): Promise<ServiceBusSessionReceiver>;
acceptSession(topicName: string, subscriptionName: string, sessionId: string, options?: ServiceBusSessionReceiverOptions<"peekLock">): Promise<ServiceBusSessionReceiver>;
acceptSession(topicName: string, subscriptionName: string, sessionId: string, options: ServiceBusSessionReceiverOptions<"receiveAndDelete">): Promise<ServiceBusSessionReceiver>;
acceptNextSession(queueName: string, options?: ServiceBusSessionReceiverOptions): Promise<ServiceBusSessionReceiver>;
acceptNextSession(topicName: string, subscriptionName: string, options?: ServiceBusSessionReceiverOptions): Promise<ServiceBusSessionReceiver>;
acceptSession(queueName: string, sessionId: string, options?: ServiceBusSessionReceiverOptions): Promise<ServiceBusSessionReceiver>;
acceptSession(topicName: string, subscriptionName: string, sessionId: string, options?: ServiceBusSessionReceiverOptions): Promise<ServiceBusSessionReceiver>;
close(): Promise<void>;
createReceiver(queueName: string, options?: ServiceBusReceiverOptions<"peekLock">): ServiceBusReceiver;
createReceiver(queueName: string, options: ServiceBusReceiverOptions<"receiveAndDelete">): ServiceBusReceiver;
createReceiver(topicName: string, subscriptionName: string, options?: ServiceBusReceiverOptions<"peekLock">): ServiceBusReceiver;
createReceiver(topicName: string, subscriptionName: string, options: ServiceBusReceiverOptions<"receiveAndDelete">): ServiceBusReceiver;
createReceiver(queueName: string, options?: ServiceBusReceiverOptions): ServiceBusReceiver;
createReceiver(topicName: string, subscriptionName: string, options?: ServiceBusReceiverOptions): ServiceBusReceiver;
createSender(queueOrTopicName: string): ServiceBusSender;
fullyQualifiedNamespace: string;
}
Expand Down Expand Up @@ -421,9 +415,9 @@ export interface ServiceBusReceiver {
}

// @public
export interface ServiceBusReceiverOptions<ReceiveModeT extends ReceiveMode> {
export interface ServiceBusReceiverOptions {
maxAutoLockRenewalDurationInMs?: number;
receiveMode?: ReceiveModeT;
receiveMode?: ReceiveMode;
subQueue?: SubQueue;
}

Expand Down Expand Up @@ -452,9 +446,9 @@ export interface ServiceBusSessionReceiver extends ServiceBusReceiver {
}

// @public
export interface ServiceBusSessionReceiverOptions<ReceiveModeT extends ReceiveMode> extends OperationOptionsBase {
export interface ServiceBusSessionReceiverOptions extends OperationOptionsBase {
maxAutoLockRenewalDurationInMs?: number;
receiveMode?: ReceiveModeT;
receiveMode?: ReceiveMode;
}

// @public
Expand Down
15 changes: 5 additions & 10 deletions sdk/servicebus/service-bus/src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ export type ReceiveMode = "peekLock" | "receiveAndDelete";
export type SubQueue = "deadLetter" | "transferDeadLetter";

/**
* @template ReceiveModeT
* Options to use when creating a receiver.
*/
export interface ServiceBusReceiverOptions<ReceiveModeT extends ReceiveMode> {
export interface ServiceBusReceiverOptions {
/**
* Represents the receive mode for the receiver.
*
Expand All @@ -100,7 +100,7 @@ export interface ServiceBusReceiverOptions<ReceiveModeT extends ReceiveMode> {
* https://docs.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock
*
*/
receiveMode?: ReceiveModeT;
receiveMode?: ReceiveMode;
/**
* Represents the sub queue that is applicable for any queue or subscription.
* Valid values are "deadLetter" and "transferDeadLetter". To learn more about dead letter queues,
Expand Down Expand Up @@ -177,13 +177,8 @@ export interface SubscribeOptions extends OperationOptionsBase {
/**
* Describes the options passed to the `acceptSession` and `acceptNextSession` methods
* when using a Queue/Subscription that has sessions enabled.
*
* @export
* @extends {OperationOptionsBase}
* @template ReceiveModeT
*/
export interface ServiceBusSessionReceiverOptions<ReceiveModeT extends ReceiveMode>
extends OperationOptionsBase {
export interface ServiceBusSessionReceiverOptions extends OperationOptionsBase {
/**
* Represents the receive mode for the receiver.
*
Expand All @@ -203,7 +198,7 @@ export interface ServiceBusSessionReceiverOptions<ReceiveModeT extends ReceiveMo
* https://docs.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock
*
*/
receiveMode?: ReceiveModeT;
receiveMode?: ReceiveMode;
/**
* @property The maximum duration in milliseconds
* until which, the lock on the session will be renewed automatically by the sdk.
Expand Down
Loading

0 comments on commit 433905b

Please sign in to comment.