camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "RasPelikan (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CAMEL-10685) TransactionErrorHandler for JavaEE environments
Date Tue, 10 Jan 2017 13:18:58 GMT

     [ https://issues.apache.org/jira/browse/CAMEL-10685?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

RasPelikan updated CAMEL-10685:
-------------------------------
    Description: 
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:
{{monospaced}}
errorHandler(transactionErrorHandler() //
                .setTransactionPolicy("PROPAGATION_SUPPORTS") //
                .maximumRedeliveries(5) //
                .maximumRedeliveryDelay(5000) //
                .collisionAvoidancePercent(10) //
                .backOffMultiplier(1.5));
from("direct:sample") //
                .transacted("PROPAGATION_REQUIRES_NEW")
                .to("bean:sampleBean");
{{monospaced}}


  was:
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:
{{errorHandler(transactionErrorHandler() //
                .setTransactionPolicy("PROPAGATION_SUPPORTS") //
                .maximumRedeliveries(5) //
                .maximumRedeliveryDelay(5000) //
                .collisionAvoidancePercent(10) //
                .backOffMultiplier(1.5));
from("direct:sample") //
                .transacted("PROPAGATION_REQUIRES_NEW")
                .to("bean:sampleBean");}}



> 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:
> {{monospaced}}
> errorHandler(transactionErrorHandler() //
>                 .setTransactionPolicy("PROPAGATION_SUPPORTS") //
>                 .maximumRedeliveries(5) //
>                 .maximumRedeliveryDelay(5000) //
>                 .collisionAvoidancePercent(10) //
>                 .backOffMultiplier(1.5));
> from("direct:sample") //
>                 .transacted("PROPAGATION_REQUIRES_NEW")
>                 .to("bean:sampleBean");
> {{monospaced}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message