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

Ramu edited comment on CAMEL-26361 at 11/25/26, 6:28 AM:
---------------------------------------------------------

Thanks [~davsclaus] for the reminder.

I've investigated the issue in detail and identified the underlying lifecycle 
mismatch between Camel's asynchronous route processing and the Azure Service 
Bus session processor.

The recommended solution depends on the new `ServiceBusProcessorAsyncClient` 
API, which is currently available in the Azure SDK beta line. I don't think 
introducing a beta dependency into Camel for a production fix would be 
appropriate.

Given the upcoming Camel 4.24.0 release and the dependency on a stable Azure 
SDK release, I may not be able to deliver a reliable fix within this release 
cycle.

I understand the priority of fixing bugs and don't want to block other 
contributors. I'll unassign myself so someone else can pick it up if they have 
an alternative approach.

Thanks for your understanding.


was (Author: ramu11):
Thanks for the reminder.

I've investigated the issue in detail and identified the underlying lifecycle 
mismatch between Camel's asynchronous route processing and the Azure Service 
Bus session processor.

The recommended solution depends on the new `ServiceBusProcessorAsyncClient` 
API, which is currently available in the Azure SDK beta line. I don't think 
introducing a beta dependency into Camel for a production fix would be 
appropriate.

Given the upcoming Camel 4.24.0 release and the dependency on a stable Azure 
SDK release, I may not be able to deliver a reliable fix within this release 
cycle.

I understand the priority of fixing bugs and don't want to block other 
contributors. I'll unassign myself so someone else can pick it up if they have 
an alternative approach.

Thanks for your understanding.

> camel-azure-servicebus - renew the session lock for session-enabled consumers 
> with async routes
> -----------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-26361
>                 URL: https://issues.apache.org/jira/browse/CAMEL-26361
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-azure-servicebus
>            Reporter: Claus Ibsen
>            Priority: Major
>             Fix For: 4.25.0
>
>
> CAMEL-23937 added Camel-managed lock renewal for the Service Bus consumer in 
> {{PEEK_LOCK}} mode. The Azure SDK's own renewal is tied to the 
> {{processMessage}} callback, which returns at once for an async route, so 
> {{maxAutoLockRenewDuration}} had no effect there.
> That fix covers only consumers without sessions. In 
> {{ServiceBusConsumer.doStart()}}, the {{LockRenewer}} is set up only when 
> {{!getConfiguration().isSessionEnabled()}}. With {{sessionEnabled=true}}, a 
> route that processes messages asynchronously can still lose the lock before 
> it completes or abandons the message, so the message is delivered again.
> Session-enabled queues and subscriptions lock the session, not the single 
> message, so the existing {{renewMessageLock()}} does not apply. Renewal needs 
> {{renewSessionLock()}} on a client bound to the session.
> h3. Proposal
> * Extend the {{LockRenewer}} (or add a session variant) to renew the session 
> lock of each session that has an exchange in flight, until 
> {{maxAutoLockRenewDuration}} is reached or the last exchange of that session 
> completes.
> * Use a receiver bound to the session that delivered the message, created 
> through {{ServiceBusClientFactory}} like the existing renewal client.
> * Keep the current behaviour when the user supplies their own 
> {{processorClient}}.
> h3. Tests
> A session-enabled consumer with an async route that takes longer than the 
> lock duration: the message is completed once and not redelivered. A unit test 
> for the renewer with a mocked client.
> _Filed by Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to