Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Debug and troubleshoot Azure Container Apps and Function Apps using logs, KQL, and health checks.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
troubleshooting/messaging/azure-servicebus-java.md
1# Azure Service Bus SDK — Java23Package: `azure-messaging-servicebus` | [README](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/servicebus/azure-messaging-servicebus/) | [Full Troubleshooting Guide](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/servicebus/azure-messaging-servicebus/TROUBLESHOOTING.md)45## Common Errors67| Exception | Cause | Fix |8|-----------|-------|-----|9| `AmqpException` (unauthorized-access) | Bad credentials or missing permissions | Verify connection string, SAS, or RBAC roles |10| `AmqpException` (connection:forced) | Idle connection or transient network issue | Auto-recovers; no action needed |11| `ServiceBusException` (MESSAGE_LOCK_LOST) | Lock expired during processing | Reduce processing time, disable auto-complete, settle manually |1213## Key Issues1415### Processor hangs with high prefetch + maxConcurrentCalls1617`Update disposition request timed out.` — Client stops processing new messages.1819**Cause**: Thread starvation when thread pool size ≤ `maxConcurrentCalls`.2021**Fix**:22```bash23# Increase reactor thread pool24-Dreactor.schedulers.defaultBoundedElasticSize=<value greater than concurrency>25```26Also set `prefetchCount(0)` to disable prefetch. This is more frequent in AKS environments.2728### Implicit prefetch in ServiceBusReceiverClient2930Even with prefetch disabled in the builder, `receiveMessages` API can re-enable prefetch implicitly. See [SyncReceiveAndPrefetch](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/servicebus/azure-messaging-servicebus/docs/SyncReceiveAndPrefetch.md).3132### Autocomplete issues3334Autocomplete and auto-lock-renewal have known issues with buffered/prefetched messages.3536**Fix**: Use `disableAutoComplete()` and `.maxAutoLockRenewalDuration(Duration.ZERO)`, then settle messages explicitly.3738## Enable Logging3940Configure via SLF4J:41```xml42<logger name="com.azure.messaging.servicebus" level="DEBUG"/>43```4445See [Java SDK logging docs](https://learn.microsoft.com/azure/developer/java/sdk/troubleshooting-messaging-service-bus-overview) for details.4647## Filing Issues4849Include: namespace tier, entity type/config, machine specs, max heap (`-Xmx`), `maxConcurrentCalls`, `prefetchCount`, autoComplete setting, traffic pattern, and DEBUG-level logs (±10 min from issue).50