[
https://issues.apache.org/jira/browse/CAMEL-10685?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15814950#comment-15814950
]
ASF GitHub Bot commented on CAMEL-10685:
----------------------------------------
GitHub user RasPelikan opened a pull request:
https://github.com/apache/camel/pull/1390
CAMEL-10685: Added camel-cdi-jee component
The "transacted" configuration requires a Spring environment. We use JavaEE
and we needed to use "transacted". We ported the Spring implementation of the
TransactionErrorHandler to JavaEE.
There is only one major difference: Spring's TransactionErrorHandler
derives from org.apache.camel.processor.RedeliveryErrorHandler which brings the
behavior that redelivery is done within the transaction. In our implementation
there is a RedeliveryErrorHandler which uses the TransactionErrorHandler to
force a rollback and create a new transaction for each redelivery.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/RasPelikan/camel CAMEL-10685_JavaEE-transacted
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/camel/pull/1390.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1390
----
commit 36c0fd1b3a82ca893da5d727a37466dc5214eef5
Author: Stephan Pelikan <[email protected]>
Date: 2017-01-10T12:59:19Z
Added camel-cdi-jee component
----
> TransactionErrorHandler for JavaEE environments
> -----------------------------------------------
>
> Key: CAMEL-10685
> URL: https://issues.apache.org/jira/browse/CAMEL-10685
> Project: Camel
> Issue Type: New Feature
> Components: camel-cdi
> Affects Versions: 2.18.1
> Reporter: RasPelikan
> Fix For: Future
>
>
> The "transacted" configuration requires a Spring environment. We use JavaEE
> and we needed to use "transacted". We ported the Spring implementation of the
> TransactionErrorHandler to JavaEE.
> There is only one major difference: Spring's TransactionErrorHandler derives
> from org.apache.camel.processor.RedeliveryErrorHandler which brings the
> behavior that redelivery is done within the transaction. In our
> implementation there is a RedeliveryErrorHandler which uses the
> TransactionErrorHandler to force a rollback and create a new transaction for
> each redelivery.
> Example usage:
> {noformat}
> errorHandler(transactionErrorHandler() //
> .setTransactionPolicy("PROPAGATION_SUPPORTS") //
> .maximumRedeliveries(5) //
> .maximumRedeliveryDelay(5000) //
> .collisionAvoidancePercent(10) //
> .backOffMultiplier(1.5));
> from("direct:sample") //
> .transacted("PROPAGATION_REQUIRES_NEW")
> .to("bean:sampleBean");
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)