Chapter 15 · Azure Diagnostics
Subchapter 15.42
troubleshooting/messaging/azure-servicebus-java.mdMarkdown2 KBView on GitHub
Package: azure-messaging-servicebus | README |
| Exception | Cause | Fix |
|---|---|---|
AmqpException (unauthorized-access) | Bad credentials or missing permissions | Verify connection string, SAS, or RBAC roles |
AmqpException (connection:forced) | Idle connection or transient network issue | Auto-recovers; no action needed |
ServiceBusException (MESSAGE_LOCK_LOST) | Lock expired during processing | Reduce processing time, disable auto-complete, settle manually |
Update disposition request timed out. — Client stops processing new messages.
Cause: Thread starvation when thread pool size ≤ maxConcurrentCalls.
Fix:
# Increase reactor thread pool
-Dreactor.schedulers.defaultBoundedElasticSize=<value greater than concurrency>Also set prefetchCount(0) to disable prefetch. This is more frequent in AKS environments.
Even with prefetch disabled in the builder, receiveMessages API can re-enable prefetch implicitly. See SyncReceiveAndPrefetch (opens in a new tab).
Autocomplete and auto-lock-renewal have known issues with buffered/prefetched messages.
Fix: Use disableAutoComplete() and .maxAutoLockRenewalDuration(Duration.ZERO), then settle messages explicitly.
Configure via SLF4J:
<logger name="com.azure.messaging.servicebus" level="DEBUG"/>See Java SDK logging docs (opens in a new tab) for details.
Include: namespace tier, entity type/config, machine specs, max heap (-Xmx), maxConcurrentCalls, prefetchCount, autoComplete setting, traffic pattern, and DEBUG-level logs (±10 min from issue).