Azure / Azure/azure-service-bus-java
'Timeout on blocking read' when sending messages
- Dominant language
- Java
- Stars
- 62
- Forks
- 63
- PR merge metrics
- No merged PRs in 30d
Description
We migrate from old azure servicebus sdk to the new one and we have a couple of of problems after the first deployment. Here's one of them:
We get several errors with the message:
...
Caused by: java.lang.IllegalStateException: Timeout on blocking read for 10400000000 NANOSECONDS
at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:123)
at reactor.core.publisher.Mono.block(Mono.java:1766)
at com.azure.messaging.servicebus.ServiceBusSenderClient.sendMessage(ServiceBusSenderClient.java:266)
....
One timestamp: "@timestamp":"2025-01-06T15:01:40.831Z"
queue: tos_trace_queue
namespace: [sbus-nonprod-sprint-main-pextnk](https://portal.azure.com/#@alpegagroup.com/resource/subscriptions/b63d93f8-a609-4298-8eea-83ade1655cb4/resourceGroups/rg-infra-nonprod/providers/Microsoft.ServiceBus/namespaces/sbus-nonprod-sprint-main-pextnk)
Sdk version: 7.17.7
Java version: 17
```
Here's the setup of the sender:
public ServiceBusSenderClient prepareSender(String queueName) {
return new ServiceBusClientBuilder()
.connectionString(....)
.retryOptions(RETRY_OPTIONS)
.sender()
.queueName(queueName)
.buildClient();
}
```
RETRY_OPTIONS are created using this code:
```
Long TIMEOUT = 2000L;
AmqpRetryOptions RETRY_OPTIONS=prepareRetryOptions();
ServiceBusSenderClient prepareSender(String entityName);
static AmqpRetryOptions prepareRetryOptions() {
AmqpRetryOptions retryOptions = new AmqpRetryOptions();
retryOptions.setMode(AmqpRetryMode.FIXED);
retryOptions.setTryTimeout(Duration.ofMillis(TIMEOUT));
return retryOptions;
}
```
Where from the 10400000000 NANOSECONDS timeout comes and how can we avoid it?
Thanks,
Cristi
C:lone: https://github.com/Azure/azure-sdk-for-java/issues/44688
Contributor guide
Assessment
This issue has not been assessed yet.