[ 
https://issues.apache.org/jira/browse/CAMEL-20660?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17851737#comment-17851737
 ] 

Dylan Piergies commented on CAMEL-20660:
----------------------------------------

4.6.0 does resolve this issue, but we have a new issue whereby the callback to 
complete the message gets executed in a Reactor thread if the destination is 
another Service Bus queue/topic. This is an issue since the high-level 
synchronous client uses the async client under the hood and the completion 
results in an invocation of {{Mono#block}}. Since invocation of {{Mono#block}} 
is not allowed on a Reactor thread, this in turn fails with an exception such 
as:

{{2024-06-03 18:14:39,069 [ctor-executor-5] WARN UnitOfWorkHelper - Exception 
occurred during onCompletion. This exception will be ignored.}}
{{java.lang.IllegalStateException: block()/blockFirst()/blockLast() are 
blocking, which is not supported in thread reactor-executor-5}}

> camel-azure-servicebus: Consumer fails to acknowledge messages
> --------------------------------------------------------------
>
>                 Key: CAMEL-20660
>                 URL: https://issues.apache.org/jira/browse/CAMEL-20660
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-azure
>    Affects Versions: 4.4.0, 4.4.1, 4.5.0
>            Reporter: Dylan Piergies
>            Priority: Major
>             Fix For: 4.x
>
>
> We have observed issues with the Service Bus consumer from Camel 4.4+ where 
> consumed messages are not acknowledged/completed correctly and landing in the 
> dead-letter queue, despite the Exchange having successfully delivered the 
> message to its destination.
> Our routes all follow the general form:
> {{from(azureServicebus(...))}}
> {{  // ...}}
> {{  .to(https(...))}}
> {{  .log("Message delivered to...");}}
> In our logs, we are seeing the message from the final {{log}} EIP and we can 
> confirm that the message has been delivered to the destination service, but 
> this is often followed by a log message from the 
> {{com.azure.messaging.servicebus.ServiceBusReceiverAsyncClient}} logger:
> {{Cannot perform operation 'completed' on a disposed receiver.}}
> We then see many of these messages arriving in the DLQ, once the retry count 
> is exceeded.
> The issue is difficult to create a reproduction for: it is intermittent and 
> occurs most frequently during a spike in message volumes.
> The issue disappears after downgrading Camel to 4.3.0.
> Whilst we do not know the root cause for sure, we suspect this may be a 
> defect of CAMEL-19262, occurring if the client is closed and recreated while 
> an Exchange is in flight.
> Related Zulip chat discussion: 
> https://camel.zulipchat.com/#narrow/stream/257298-camel/topic/Azure.20Service.20Bus.20Consumer.20failing.20to.20acknowledge.20messages



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to