Ce contenu n'est pas disponible dans la langue sélectionnée.

Chapter 43. JTA


Enclose Camel routes in transactions using Java Transaction API (JTA) and Narayana transaction manager

43.1. What’s inside

Please refer to the above link for usage and configuration details.

43.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-jta</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

43.3. Usage

This extension should be added when you need to use the transacted() EIP in the router. It leverages the transaction capabilities provided by the narayana-jta extension in Quarkus.

Refer to the Quarkus Transaction guide for the more details about transaction support. For a simple usage:

from("direct:transaction")
    .transacted()
    .to("sql:INSERT INTO A TABLE ...?dataSource=ds1")
    .to("sql:INSERT INTO A TABLE ...?dataSource=ds2")
    .log("all data are in the ds1 and ds2")
Copy to Clipboard Toggle word wrap

Support is provided for various transaction policies.

Expand
PolicyDescription

PROPAGATION_MANDATORY

Support a current transaction; throw an exception if no current transaction exists.

PROPAGATION_NEVER

Do not support a current transaction; throw an exception if a current transaction exists.

PROPAGATION_NOT_SUPPORTED

Do not support a current transaction; rather always execute non-transactionally.

PROPAGATION_REQUIRED

Support a current transaction; create a new one if none exists.

PROPAGATION_REQUIRES_NEW

Create a new transaction, suspending the current transaction if one exists.

PROPAGATION_SUPPORTS

Support a current transaction; execute non-transactionally if none exists.

Retour au début
Red Hat logoGithubredditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance. Découvrez nos récentes mises à jour.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez le Blog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

Theme

© 2025 Red Hat