zhfeng commented on a change in pull request #1411:
URL: https://github.com/apache/camel-quarkus/pull/1411#discussion_r444880064



##########
File path: extensions/jta/runtime/pom.xml
##########
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0";
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.camel.quarkus</groupId>
+        <artifactId>camel-quarkus-jta-parent</artifactId>
+        <version>1.1.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>camel-quarkus-jta</artifactId>
+    <name>Camel Quarkus :: JTA :: Runtime</name>
+    <description>Using Camel with JTA Transaction Manager</description>

Review comment:
       OK, I see. For a typical JTA transaction used to update the two 
databases, just like
   ```java
   from("direct:update_two_databases")
       .transacted()
       .to("sql:update tbl?datasource=db1")
       .to("sql:update_tbl?datasource=db2")
   ```
   The two database are "distributed" and both of them has a local transaction 
internally. The db talks to the transaction manager with the XA protocol and it 
is driven by the 2PC protocol to get to the consistent state whenever the 
transaction manager has a decision to commit or rollback a transaction. This 
transaction should be associated with a thread in the whole lifecycle of the 
processing.
   
   Let's take a look at the following scenario, route 1 and route 2 are in the 
different process or host
   route1
   ```java
   from("direct:update_two_databases_in_different_service")
       .transacted()
       .to("sql:update_tbl?datasource=db1")
       .to("http://localhost:8080/update_db2";)
   ```
   route2
   ```java
   from("netty-http:localhost:8080/update_db2")
       .transacted()
       .to("sql:update_tbl?datasource=db2")
   ```
   So the transaction must be propagated between the http invoking, and we call 
it "the distributed transaction". But the JTA spec does not define the protocol 
of the transaction propagation. Then with the Narayana JTA implementation, I 
think it can not provide this capability. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to