[
https://issues.apache.org/jira/browse/CAMEL-17174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17440285#comment-17440285
]
marc eiro edited comment on CAMEL-17174 at 11/8/21, 8:46 AM:
-------------------------------------------------------------
Hi Claus,
I've been looking at the GIT history for changes in the {{UnitOfWorkHelper}}
class and found that in the past the UoW was being cleared correctly (you
introduced the change on the 29.01.20 -
[https://github.com/apache/camel/commit/e2da037e797d64e402bc6ca526d255ad112476f2):|https://github.com/apache/camel/commit/e2da037e797d64e402bc6ca526d255ad112476f2),]
{code:java}
// MUST clear and set uow to null on exchange after done
ExtendedExchange ee = (ExtendedExchange) exchange;
ee.setUnitOfWork(null); {code}
However, this change doesn't seem to exist anymore in main, it did somehow get
lost with 8c2939c45f67cc84c36e8ec2973eadda95477155?
The issue is reproducible in one of our RetryHanlder JUnit tests, which in a
nutshell does the following:
# Defines a simple route from A to endpoint B
# Creates an file type exchange
({{{}testExchange.setProperty(FileComponent.{*}_FILE_EXCHANGE_FILE_{*},
testFile)){}}}
# Sets a route interceptor that on processing throws an exception
# Sends the created exchange from A to B (using a ProducerTemplate)
# Sends again the same exchange from A to B
# Asserts that our RetryHandler (which basically listens for
CreatedExchangeEvents) is invoked twice
was (Author: m4rc3iro):
Hi Claus,
I've been looking at the GIT history and found that in the past the UoW was
being cleared correctly (you introduced the change on the 29.01.20 -
[https://github.com/apache/camel/commit/e2da037e797d64e402bc6ca526d255ad112476f2):|https://github.com/apache/camel/commit/e2da037e797d64e402bc6ca526d255ad112476f2),]
{code:java}
// MUST clear and set uow to null on exchange after done
ExtendedExchange ee = (ExtendedExchange) exchange;
ee.setUnitOfWork(null); {code}
However, this change doesn't seem to exist anymore in main, it did somehow get
lost with 8c2939c45f67cc84c36e8ec2973eadda95477155?
The issue is reproducible in one of our RetryHanlder JUnit tests, which in a
nutshell does the following:
# Defines a simple route from A to endpoint B
# Creates an file type exchange
({{{}testExchange.setProperty(FileComponent.*_FILE_EXCHANGE_FILE_*,
testFile)){}}}
# Sets a route interceptor that on processing throws an exception
# Sends the created exchange from A to B (using a ProducerTemplate)
# Sends again the same exchange from A to B
# Asserts that our RetryHandler (which basically listens for
CreatedExchangeEvents) is invoked twice
> UnitOfWorkHelper doesn't clear UoW when job is done
> ---------------------------------------------------
>
> Key: CAMEL-17174
> URL: https://issues.apache.org/jira/browse/CAMEL-17174
> Project: Camel
> Issue Type: Bug
> Components: camel-core
> Affects Versions: 3.12.0
> Reporter: marc eiro
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 3.14.0
>
>
> In 2.x, UnitOfWorkHelper used to remove the UoW from exchange when the job
> was done, however this is not the case anymore in 3.x.
> Exchanges now seem to reuse UoW after work completion and thus
> ExchangeCreatedEvents are not created as they were before.
> This is causing issues on functionality that depends on such Created events,
> and regressions to appear.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)