Azure Service Bus SDK — Java
Package: azure-messaging-servicebus | README | Full Troubleshooting Guide
Common Errors
| 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 (MESSAGELOCKLOST) | Lock expired during processing | Reduce processing time, disable auto-complete, settle manually |
Key Issues
Processor hangs with high prefetch + maxConcurrentCalls
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.
Implicit prefetch in ServiceBusReceiverClient
Even with prefetch disabled in the builder, receiveMessages API can re-enable prefetch implicitly. See SyncReceiveAndPrefetch.
Autocomplete issues
Autocomplete and auto-lock-renewal have known issues with buffered/prefetched messages.
Fix: Use disableAutoComplete() and .maxAutoLockRenewalDuration(Duration.ZERO), then settle messages explicitly.
Enable Logging
Configure via SLF4J:
<logger name="com.azure.messaging.servicebus" level="DEBUG"/>See Java SDK logging docs for details.
Filing Issues
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).