zhfeng opened a new issue, #4279:
URL: https://github.com/apache/camel-quarkus/issues/4279

   I'm trying to incorporate JMS consumer in a XA router such lik:
   ```
   from("xajms:outbound")
                   .transacted()
                   .log("Message out: ${body}")
                   .to("bean:auditLog?method=createAuditLog(${body}-ok)")
                   .to("jpa:org.acme.AuditLog");
   ``` 
   
   And a XA JMS Component could be 
   
   ```
    @Produces
       @Named("xajms")
       public JmsComponent xaJms() {
           JmsComponent component = new JmsComponent();
           component.setConnectionFactory(connectionFactory);
           component.setTransacted(false);
   
           JtaTransactionManager jtaTransactionManager = new 
JtaTransactionManager(userTransaction, transactionManager);
           
jtaTransactionManager.setTransactionSynchronizationRegistry(transactionSynchronizationRegistry);
           component.setTransactionManager(jtaTransactionManager);
           return component;
       }
   ```
   But it can not receive any message from the queue and the warn messaging is
   ```
   2022-11-17 10:21:31,014 WARN  
[org.apa.cam.com.jms.DefaultJmsMessageListenerContainer] (Camel (camel-1) 
thread #1 - JmsConsumer[outbound]) Setup of JMS message listener invoker failed 
for destination 'outbound' - trying to recover. Cause: 
'org.springframework.transaction.TransactionStatus 
org.springframework.transaction.PlatformTransactionManager.getTransaction(org.springframework.transaction.TransactionDefinition)':
 java.lang.NoSuchMethodError: 
'org.springframework.transaction.TransactionStatus 
org.springframework.transaction.PlatformTransactionManager.getTransaction(org.springframework.transaction.TransactionDefinition)'
        at 
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:243)
        at 
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1237)
        at 
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1227)
        at 
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1120)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:829)
   
   ```
   
   I think the root cause is that we introduced 
[PlatformTransactionManager](https://github.com/apache/camel-quarkus/blob/main/extensions/jpa/runtime/src/main/java/org/springframework/transaction/PlatformTransactionManager.java)
 in `camel-quarkus-jpa` which is just to make the graal native building happy 
to do the static analyst.  So it needs to import `PlatformTransactionManager` 
interface completely since the `camel-jms` has to depend on `spring-tx`.
   
   It might be an other better way to do such things with native building. 
@jamesnetherton @ppalaga WDYT?


-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org.apache.org

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

Reply via email to