Copy over state for multicast eip

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Copy over state for multicast eip

Benjamin Graf
Hi together,

https://issues.apache.org/jira/browse/CAMEL-14354 introduces a change to ExchangeHelper to copy internal state of child exchanges to parent exchanges. Especially the code addition from https://github.com/apache/camel/blob/a9fd03f1d022a48553207ab59e42f35b8cd6c325/core/camel-support/src/main/java/org/apache/camel/support/ExchangeHelper.java#L417-L418 is causing troubles for my custom error handling policy because rollback states are set to false on parent after errorhandler has set it back to false on child exchange and multicast does the copy over. This makes my transaction separation actually impossible for multicast use cases causing rollbacks to AMQ and DLQ the latter one.

Is this really intended or maybe a bug/race condition of the patch after 3.1 ongoing?

Best regards
Benjamin
Reply | Threaded
Open this post in threaded view
|

Re: Copy over state for multicast eip

Claus Ibsen-2
Hi

I suggest if you can put together a small example / unit test or
something that demonstrates what you are doing and why you need to do
custom error handling.
And put it on github or in a JIRA ticket.


On Tue, Apr 6, 2021 at 10:13 AM Benjamin Graf <[hidden email]> wrote:
>
> Hi together,
>
> https://issues.apache.org/jira/browse/CAMEL-14354 introduces a change to ExchangeHelper to copy internal state of child exchanges to parent exchanges. Especially the code addition from https://github.com/apache/camel/blob/a9fd03f1d022a48553207ab59e42f35b8cd6c325/core/camel-support/src/main/java/org/apache/camel/support/ExchangeHelper.java#L417-L418 is causing troubles for my custom error handling policy because rollback states are set to false on parent after errorhandler has set it back to false on child exchange and multicast does the copy over. This makes my transaction separation actually impossible for multicast use cases causing rollbacks to AMQ and DLQ the latter one.
>
> Is this really intended or maybe a bug/race condition of the patch after 3.1 ongoing?
>
> Best regards
> Benjamin



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Reply | Threaded
Open this post in threaded view
|

Re: Copy over state for multicast eip

Benjamin Graf
Hi Clause,

well, the code is quite to complex to put it into an easy test case. But
I can share the idea. We're using nested transaction to separate
incoming MQ system from several transactional systems. In case of error
we do disqualify message to kind of deadletter queue and rollback all
actions already done. That's why we use rollbackonlylast feature to let
initial jms transaction being committed successfully, while  all other
operations are rollbacked. But with multicast the rollbackonlylast of
parent exchange is set to false again after child exchange has been
handled by transactional errorhandler and copy of state in
MulticastProcessor has been done. Since this change has been introduced
with Camel 3.1 the question is whether too much information is copied
from child to parent or not.

Best regards

Benjamin

On 07.04.2021 15:42, Claus Ibsen wrote:

> Hi
>
> I suggest if you can put together a small example / unit test or
> something that demonstrates what you are doing and why you need to do
> custom error handling.
> And put it on github or in a JIRA ticket.
>
>
> On Tue, Apr 6, 2021 at 10:13 AM Benjamin Graf <[hidden email]> wrote:
>> Hi together,
>>
>> https://issues.apache.org/jira/browse/CAMEL-14354 introduces a change to ExchangeHelper to copy internal state of child exchanges to parent exchanges. Especially the code addition from https://github.com/apache/camel/blob/a9fd03f1d022a48553207ab59e42f35b8cd6c325/core/camel-support/src/main/java/org/apache/camel/support/ExchangeHelper.java#L417-L418 is causing troubles for my custom error handling policy because rollback states are set to false on parent after errorhandler has set it back to false on child exchange and multicast does the copy over. This makes my transaction separation actually impossible for multicast use cases causing rollbacks to AMQ and DLQ the latter one.
>>
>> Is this really intended or maybe a bug/race condition of the patch after 3.1 ongoing?
>>
>> Best regards
>> Benjamin
>
>


OpenPGP_signature (505 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Copy over state for multicast eip

Claus Ibsen-2
Hi

Ah okay so it's not the "too much" is copied over.
But the fact before the rollback_last was stored as property, which
had 3 states: null, true, false
And now its optimized into a simple boolean that has: true, false


On Wed, Apr 7, 2021 at 7:15 PM Benjamin Graf <[hidden email]> wrote:

>
> Hi Clause,
>
> well, the code is quite to complex to put it into an easy test case. But
> I can share the idea. We're using nested transaction to separate
> incoming MQ system from several transactional systems. In case of error
> we do disqualify message to kind of deadletter queue and rollback all
> actions already done. That's why we use rollbackonlylast feature to let
> initial jms transaction being committed successfully, while  all other
> operations are rollbacked. But with multicast the rollbackonlylast of
> parent exchange is set to false again after child exchange has been
> handled by transactional errorhandler and copy of state in
> MulticastProcessor has been done. Since this change has been introduced
> with Camel 3.1 the question is whether too much information is copied
> from child to parent or not.
>
> Best regards
>
> Benjamin
>
> On 07.04.2021 15:42, Claus Ibsen wrote:
> > Hi
> >
> > I suggest if you can put together a small example / unit test or
> > something that demonstrates what you are doing and why you need to do
> > custom error handling.
> > And put it on github or in a JIRA ticket.
> >
> >
> > On Tue, Apr 6, 2021 at 10:13 AM Benjamin Graf <[hidden email]> wrote:
> >> Hi together,
> >>
> >> https://issues.apache.org/jira/browse/CAMEL-14354 introduces a change to ExchangeHelper to copy internal state of child exchanges to parent exchanges. Especially the code addition from https://github.com/apache/camel/blob/a9fd03f1d022a48553207ab59e42f35b8cd6c325/core/camel-support/src/main/java/org/apache/camel/support/ExchangeHelper.java#L417-L418 is causing troubles for my custom error handling policy because rollback states are set to false on parent after errorhandler has set it back to false on child exchange and multicast does the copy over. This makes my transaction separation actually impossible for multicast use cases causing rollbacks to AMQ and DLQ the latter one.
> >>
> >> Is this really intended or maybe a bug/race condition of the patch after 3.1 ongoing?
> >>
> >> Best regards
> >> Benjamin
> >
> >
>


--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2