Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-10685

TransactionErrorHandler and TransactionPolicy for Camel CDI / JavaEE

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.19.0
    • Component/s: camel-cdi
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      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:

      errorHandler(transactionErrorHandler() //
                      .setTransactionPolicy("PROPAGATION_SUPPORTS") //
                      .maximumRedeliveries(5) //
                      .maximumRedeliveryDelay(5000) //
                      .collisionAvoidancePercent(10) //
                      .backOffMultiplier(1.5));
      from("direct:sample") //
                      .transacted("PROPAGATION_REQUIRES_NEW")
                      .to("bean:sampleBean");
      

        Attachments

          Activity

            People

            • Assignee:
              antonin.stefanutti Antonin Stefanutti
              Reporter:
              RasPelikan RasPelikan

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment