Skip to content

Commit

Permalink
Ensure ServiceBus session idle timeout fall back to retry-options::tr…
Browse files Browse the repository at this point in the history
…y-timeout (#39994)
  • Loading branch information
anuchandy committed May 2, 2024
1 parent 938279a commit c6c520e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Bugs Fixed

- Fixes the session message disposition to use management node as fall back. ([#39913](https://github.com/Azure/azure-sdk-for-java/issues/ 39913))
- Fixes the session processor idle timeout to fall back to RetryOptions::tryTimeout. ([#39993](https://github.com/Azure/azure-sdk-for-java/issues/39993))

### Other Changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ final class SessionsMessagePump {
this.instrumentation = Objects.requireNonNull(instrumentation, "'instrumentation' cannot be null");
this.sessionAcquirer = Objects.requireNonNull(sessionAcquirer, "'sessionAcquirer' cannot be null");
this.maxSessionLockRenew = Objects.requireNonNull(maxSessionLockRenew, "'maxSessionLockRenew' cannot be null.");
this.sessionIdleTimeout = sessionIdleTimeout;
this.sessionIdleTimeout = sessionIdleTimeout != null ? sessionIdleTimeout : retryPolicy.getRetryOptions().getTryTimeout();
this.maxConcurrentSessions = maxConcurrentSessions;
this.concurrencyPerSession = concurrencyPerSession;
this.prefetch = prefetch;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,10 +471,16 @@ protected final Configuration v1OrV2(boolean isV2) {
if (isV2) {
configSource.put("com.azure.messaging.servicebus.nonSession.asyncReceive.v2", "true");
configSource.put("com.azure.messaging.servicebus.nonSession.syncReceive.v2", "true");
configSource.put("com.azure.messaging.servicebus.session.processor.asyncReceive.v2", "true");
configSource.put("com.azure.messaging.servicebus.session.reactor.asyncReceive.v2", "true");
configSource.put("com.azure.messaging.servicebus.session.syncReceive.v2", "true");
configSource.put("com.azure.messaging.servicebus.sendAndManageRules.v2", "true");
} else {
configSource.put("com.azure.messaging.servicebus.nonSession.asyncReceive.v2", "false");
configSource.put("com.azure.messaging.servicebus.nonSession.syncReceive.v2", "false");
configSource.put("com.azure.messaging.servicebus.session.processor.asyncReceive.v2", "false");
configSource.put("com.azure.messaging.servicebus.session.reactor.asyncReceive.v2", "false");
configSource.put("com.azure.messaging.servicebus.session.syncReceive.v2", "false");
configSource.put("com.azure.messaging.servicebus.sendAndManageRules.v2", "false");
}
return new ConfigurationBuilder(configSource)
Expand Down

0 comments on commit c6c520e

Please sign in to comment.