Skip to content

Commit 3c5cc69

Browse files
authored
[event-hubs][service-bus] re-export RetryMode (Azure#13484)
* [event-hubs] re-export RetryMode * [service-bus] re-export RetryMode
1 parent 5cd508c commit 3c5cc69

File tree

8 files changed

+54
-3
lines changed

8 files changed

+54
-3
lines changed

sdk/eventhub/event-hubs/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
allow communicating to the standard Event Hubs endpoint.
1313
Resolves [#12901](https://github.com/Azure/azure-sdk-for-js/issues/12901).
1414

15+
- Re-exports `RetryMode` for use when setting the `RetryOptions.mode` field
16+
in `EventHubConsumerClientOptions` or `EventHubClientOptions`.
17+
Resolves [#13166](https://github.com/Azure/azure-sdk-for-js/issues/13166).
18+
1519
- Updates documentation for `EventData` to call out that the `body` field
1620
must be converted to a byte array or `Buffer` when cross-language
1721
compatibility while receiving events is required.

sdk/eventhub/event-hubs/review/event-hubs.api.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import { AbortSignalLike } from '@azure/abort-controller';
88
import { MessagingError } from '@azure/core-amqp';
99
import { OperationTracingOptions } from '@azure/core-tracing';
10+
import { RetryMode } from '@azure/core-amqp';
1011
import { RetryOptions } from '@azure/core-amqp';
1112
import { Span } from '@opentelemetry/api';
1213
import { SpanContext } from '@opentelemetry/api';
@@ -248,6 +249,8 @@ export interface ReceivedEventData {
248249
};
249250
}
250251

252+
export { RetryMode }
253+
251254
export { RetryOptions }
252255

253256
// @public

sdk/eventhub/event-hubs/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export { EventDataBatch, TryAddOptions } from "./eventDataBatch";
3535
export { Checkpoint } from "./partitionProcessor";
3636
export { CheckpointStore, PartitionOwnership } from "./eventProcessor";
3737
export { CloseReason } from "./models/public";
38-
export { MessagingError, RetryOptions, WebSocketOptions } from "@azure/core-amqp";
38+
export { MessagingError, RetryOptions, RetryMode, WebSocketOptions } from "@azure/core-amqp";
3939
export { TokenCredential } from "@azure/core-auth";
4040
export { logger } from "./log";
4141
export {

sdk/eventhub/event-hubs/src/models/public.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,14 @@ export enum CloseReason {
9797
* - `webSocketConstructorOptions` : Options to pass to the Websocket constructor when you choose to make the connection
9898
* over a WebSocket.
9999
* - `retryOptions` : The retry options for all the operations on the client/producer/consumer.
100+
* - `maxRetries` : The number of times the operation can be retried in case of a retryable error.
101+
* - `maxRetryDelayInMs`: The maximum delay between retries. Applicable only when performing exponential retries.
102+
* - `mode`: Which retry mode to apply, specified by the `RetryMode` enum. Options are `Exponential` and `Fixed`. Defaults to `Fixed`.
103+
* - `retryDelayInMs`: Amount of time to wait in milliseconds before making the next attempt. When `mode` is set to `Exponential`,
104+
* this is used to compute the exponentially increasing delays between retries. Default: 30000 milliseconds.
105+
* - `timeoutInMs`: Amount of time in milliseconds to wait before the operation times out. This will trigger a retry if there are any
106+
* retry attempts remaining. Minimum value: 60000 milliseconds.
107+
*
100108
* A simple usage can be `{ "maxRetries": 4 }`.
101109
*
102110
* Example usage:
@@ -121,6 +129,7 @@ export interface EventHubClientOptions {
121129
/**
122130
* Options to configure the retry policy for all the operations on the client.
123131
* For example, `{ "maxRetries": 4 }` or `{ "maxRetries": 4, "retryDelayInMs": 30000 }`.
132+
*
124133
*/
125134
retryOptions?: RetryOptions;
126135
/**
@@ -143,7 +152,15 @@ export interface EventHubClientOptions {
143152
* over a WebSocket.
144153
* - `webSocketConstructorOptions` : Options to pass to the Websocket constructor when you choose to make the connection
145154
* over a WebSocket.
146-
* - `retryOptions` : The retry options for all the operations on the EventHubConsumerClient.
155+
* - `retryOptions` : The retry options for all the operations on the client/producer/consumer.
156+
* - `maxRetries` : The number of times the operation can be retried in case of a retryable error.
157+
* - `maxRetryDelayInMs`: The maximum delay between retries. Applicable only when performing exponential retries.
158+
* - `mode`: Which retry mode to apply, specified by the `RetryMode` enum. Options are `Exponential` and `Fixed`. Defaults to `Fixed`.
159+
* - `retryDelayInMs`: Amount of time to wait in milliseconds before making the next attempt. When `mode` is set to `Exponential`,
160+
* this is used to compute the exponentially increasing delays between retries. Default: 30000 milliseconds.
161+
* - `timeoutInMs`: Amount of time in milliseconds to wait before the operation times out. This will trigger a retry if there are any
162+
* retry attempts remaining. Minimum value: 60000 milliseconds.
163+
*
147164
* A simple usage can be `{ "maxRetries": 4 }`.
148165
*
149166
* Example usage:

sdk/servicebus/service-bus/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## 7.0.4 (Unreleased)
44

5+
- Re-exports `RetryMode` for use when setting the `RetryOptions.mode` field
6+
in `ServiceBusClientOptions`.
7+
Resolves [#13166](https://github.com/Azure/azure-sdk-for-js/issues/13166).
58

69
## 7.0.3 (2021-01-26)
710

sdk/servicebus/service-bus/review/service-bus.api.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { OperationOptions } from '@azure/core-http';
1414
import { PagedAsyncIterableIterator } from '@azure/core-paging';
1515
import { PageSettings } from '@azure/core-paging';
1616
import { PipelineOptions } from '@azure/core-http';
17+
import { RetryMode } from '@azure/core-amqp';
1718
import { RetryOptions } from '@azure/core-amqp';
1819
import { ServiceClient } from '@azure/core-http';
1920
import { Span } from '@opentelemetry/api';
@@ -221,6 +222,8 @@ export interface ReceiveMessagesOptions extends OperationOptionsBase {
221222
maxWaitTimeInMs?: number;
222223
}
223224

225+
export { RetryMode }
226+
224227
export { RetryOptions }
225228

226229
// @public

sdk/servicebus/service-bus/src/constructorHelpers.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@ import { SharedKeyCredential } from "./servicebusSharedKeyCredential";
99

1010
/**
1111
* Describes the options that can be provided while creating the ServiceBusClient.
12+
*
13+
* - `webSocketOptions` : Options to configure the channelling of the AMQP connection over Web Sockets.
14+
* - `websocket` : The WebSocket constructor used to create an AMQP connection if you choose to make the connection
15+
* over a WebSocket.
16+
* - `webSocketConstructorOptions` : Options to pass to the Websocket constructor when you choose to make the connection
17+
* over a WebSocket.
18+
* - `retryOptions` : The retry options for all the operations on the client.
19+
* - `maxRetries` : The number of times the operation can be retried in case of a retryable error.
20+
* - `maxRetryDelayInMs`: The maximum delay between retries. Applicable only when performing exponential retries.
21+
* - `mode`: Which retry mode to apply, specified by the `RetryMode` enum. Options are `Exponential` and `Fixed`. Defaults to `Fixed`.
22+
* - `retryDelayInMs`: Amount of time to wait in milliseconds before making the next attempt. When `mode` is set to `Exponential`,
23+
* this is used to compute the exponentially increasing delays between retries. Default: 30000 milliseconds.
24+
* - `timeoutInMs`: Amount of time in milliseconds to wait before the operation times out. This will trigger a retry if there are any
25+
* retry attempts remaining. Minimum value: 60000 milliseconds.
1226
*/
1327
export interface ServiceBusClientOptions {
1428
/**

sdk/servicebus/service-bus/src/index.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
/// <reference lib="es2015" />
55
/// <reference lib="esnext.asynciterable" />
66

7-
export { delay, MessagingError, RetryOptions, TokenType, WebSocketOptions } from "@azure/core-amqp";
7+
export {
8+
delay,
9+
MessagingError,
10+
RetryOptions,
11+
RetryMode,
12+
TokenType,
13+
WebSocketOptions
14+
} from "@azure/core-amqp";
815
export { TokenCredential } from "@azure/core-auth";
916
export { OperationOptions } from "@azure/core-http";
1017
export { Delivery, WebSocketImpl } from "rhea-promise";

0 commit comments

Comments
 (0)