[GitHub] [camel-quarkus] zhfeng opened a new issue #1197: transacted() support in camel-quarkus

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] [camel-quarkus] zhfeng opened a new issue #1197: transacted() support in camel-quarkus

GitBox

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


   It looks like failing with
   ```
   Caused by: java.lang.RuntimeException: org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: >>> Transacted <<< in route: Route(route1)[From[timer:foo?period=5000] -> [Transacted]] because of policy must be specified on: org.apache.camel.reifier.TransactedReifier@61710c6
    at org.apache.camel.quarkus.core.CamelMainRecorder.start(CamelMainRecorder.java:98)
    at io.quarkus.deployment.steps.Main$start29.deploy_0(Main$start29.zig:97)
    at io.quarkus.deployment.steps.Main$start29.deploy(Main$start29.zig:36)
    at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:153)
    ... 6 more
   Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: >>> Transacted <<< in route: Route(route1)[From[timer:foo?period=5000] -> [Transacted]] because of policy must be specified on: org.apache.camel.reifier.TransactedReifier@61710c6
    at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:393)
    at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:117)
    at org.apache.camel.quarkus.core.FastCamelContext.startRouteDefinitions(FastCamelContext.java:669)
    at org.apache.camel.quarkus.core.FastCamelContext.startRouteDefinitions(FastCamelContext.java:481)
    at org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:2598)
    at org.apache.camel.quarkus.core.FastCamelContext.doInit(FastCamelContext.java:367)
    at org.apache.camel.support.service.BaseService.init(BaseService.java:83)
    at org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2431)
    at org.apache.camel.quarkus.core.CamelMain.doInit(CamelMain.java:49)
    at org.apache.camel.support.service.BaseService.init(BaseService.java:83)
    at org.apache.camel.support.service.BaseService.start(BaseService.java:111)
    at org.apache.camel.quarkus.core.CamelMainRecorder.start(CamelMainRecorder.java:96)
    ... 9 more
   Caused by: java.lang.IllegalArgumentException: policy must be specified on: org.apache.camel.reifier.TransactedReifier@61710c6
    at org.apache.camel.util.ObjectHelper.notNull(ObjectHelper.java:171)
    at org.apache.camel.reifier.TransactedReifier.createProcessor(TransactedReifier.java:41)
    at org.apache.camel.reifier.ProcessorReifier.makeProcessor(ProcessorReifier.java:766)
    at org.apache.camel.reifier.ProcessorReifier.addRoutes(ProcessorReifier.java:511)
    at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:391)
    ... 20 more
   
   ```
   since it does not support the camel-spring and that means we can not use the SpringTransactedPolicy any more. I wonder it is possible to create a new QuarkusTransactedPolicy which could leverage the CDITransactionManager from the narayana-jta extenstion.


----------------------------------------------------------------
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:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

[GitHub] [camel-quarkus] vladimirfx commented on issue #1197: transacted() support in camel-quarkus

GitBox

vladimirfx commented on issue #1197:
URL: https://github.com/apache/camel-quarkus/issues/1197#issuecomment-632629956


   It is already implemented in camel-cdi. But camel-cdi itself crashes Quarkus when added as dependency. If anyone know how to exclude CDI factory from Quarkus Arc resolution please answer this question:
   
   https://stackoverflow.com/questions/61952174/how-to-exclude-3rd-party-cdi-bean-factory-from-quarkus-arc-bean-resolution


----------------------------------------------------------------
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:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

[GitHub] [camel-quarkus] jamesnetherton commented on issue #1197: transacted() support in camel-quarkus

GitBox
In reply to this post by GitBox

jamesnetherton commented on issue #1197:
URL: https://github.com/apache/camel-quarkus/issues/1197#issuecomment-632669756


   camel-cdi is meant for when the Camel application is deployed into a full CDI container (E.g Weld etc). There is currently no camel-quarkus extension for it and its unlikely there ever will be because we provide CDI support via integration with Quarkus Arc out of the box.
   
   Also, I think the `TransactedPolicy` support in camel-cdi is dependent on the `java:/TransactionManager` JNDI binding. This wont work on Quarkus since there is no JNDI support.
   
   The proper solution for this is likely as @zhfeng mentions:
   
   > Create a new QuarkusTransactedPolicy which could leverage the CDITransactionManager from the narayana-jta extenstion


----------------------------------------------------------------
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:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

[GitHub] [camel-quarkus] jamesnetherton commented on issue #1197: transacted() support in camel-quarkus

GitBox
In reply to this post by GitBox

jamesnetherton commented on issue #1197:
URL: https://github.com/apache/camel-quarkus/issues/1197#issuecomment-632669824


   @zhfeng are you planning to work on this issue?


----------------------------------------------------------------
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:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

[GitHub] [camel-quarkus] zhfeng commented on issue #1197: transacted() support in camel-quarkus

GitBox
In reply to this post by GitBox

zhfeng commented on issue #1197:
URL: https://github.com/apache/camel-quarkus/issues/1197#issuecomment-632709981


   @jamesnetherton yeah, I had an initial change to introduce the QuarkusTransactedPolicy
   you can see https://github.com/zhfeng/camel-quarkus/compare/master...issue_1197_transacted?expand=1
   
   It works to get the TransactionManger while add the dependency of io.quarkus:quarkus-narayana-jta. Then the most difficult thing is to do the similar functions with the Spring Transaction Template to wrap the processor inside the transaction context
   ```
   transactionTemplate.execute(new TransactionCallbackWithoutResult() {
   ...
   });
   ```


----------------------------------------------------------------
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:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

[GitHub] [camel-quarkus] vladimirfx commented on issue #1197: transacted() support in camel-quarkus

GitBox
In reply to this post by GitBox

vladimirfx commented on issue #1197:
URL: https://github.com/apache/camel-quarkus/issues/1197#issuecomment-633006364


   > camel-cdi is meant for when the Camel application is deployed into a full CDI container (E.g Weld etc). There is currently no camel-quarkus extension for it and its unlikely there ever will be because we provide CDI support via integration with Quarkus Arc out of the box.
   
   Actually it is my main question - how to DISABLE scanning of CDI beans for Arc. It is not needed in this case. And many other cases I think. Current situation is very strange - there is no CDI support but CDI beans from dependencies completely broke Quarkus own DI. Very annoying...
   
   > Also, I think the `TransactedPolicy` support in camel-cdi is dependent on the `java:/TransactionManager` JNDI binding. This wont work on Quarkus since there is no JNDI support.
   
   It is a simplest part - trivial subclass on needed policy (may be inside routes dentition class) can inject TransactionManager from Quarkus into protected JtaTransactionPolicy.transactionManager .
   Actually it is what I starter from. That approach is more explicit than all that CDI magic.
   Interestingly, `org.apache.camel.cdi.transaction` do not depend on CDI at all (@Resource is not CDI only thing). It would be nice to extract this implementation in its own module.
   
   What do you think?


----------------------------------------------------------------
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:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

[GitHub] [camel-quarkus] vladimirfx commented on issue #1197: transacted() support in camel-quarkus

GitBox
In reply to this post by GitBox

vladimirfx commented on issue #1197:
URL: https://github.com/apache/camel-quarkus/issues/1197#issuecomment-633006820


   > @jamesnetherton yeah, I had an initial change to introduce the QuarkusTransactedPolicy
   > you can see https://github.com/zhfeng/camel-quarkus/compare/master...issue_1197_transacted?expand=1
   >
   > It works to get the TransactionManger while add the dependency of io.quarkus:quarkus-narayana-jta. Then the most difficult thing is to do the similar functions with the Spring Transaction Template to wrap the processor inside the transaction context
   >
   > ```
   > transactionTemplate.execute(new TransactionCallbackWithoutResult() {
   > ...
   > });
   > ```
   
   Camel already has fully functional and proven JTA based transacted policy. I think it is not optimal to implement another one from scratch. See my previous comment for implementation idea.


----------------------------------------------------------------
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:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

[GitHub] [camel-quarkus] zhfeng commented on issue #1197: transacted() support in camel-quarkus

GitBox
In reply to this post by GitBox

zhfeng commented on issue #1197:
URL: https://github.com/apache/camel-quarkus/issues/1197#issuecomment-633235634


   > Interestingly, org.apache.camel.cdi.transaction do not depend on CDI at all (@resource is not CDI only thing). It would be nice to extract this implementation in its own module.
   >
   > What do you think?
   Good point here - I think it could be helpful and will raise a CAMEL ticket for it.


----------------------------------------------------------------
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:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

[GitHub] [camel-quarkus] zhfeng edited a comment on issue #1197: transacted() support in camel-quarkus

GitBox
In reply to this post by GitBox

zhfeng edited a comment on issue #1197:
URL: https://github.com/apache/camel-quarkus/issues/1197#issuecomment-633235634


   > Interestingly, org.apache.camel.cdi.transaction do not depend on CDI at all (@resource is not CDI only thing). It would be nice to extract this implementation in its own module.
   >
   > What do you think?
   
   Good point here - I think it could be helpful and will raise a CAMEL ticket for it.


----------------------------------------------------------------
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:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

[GitHub] [camel-quarkus] zhfeng commented on issue #1197: transacted() support in camel-quarkus

GitBox
In reply to this post by GitBox

zhfeng commented on issue #1197:
URL: https://github.com/apache/camel-quarkus/issues/1197#issuecomment-633337284


   FYI, I raise [CAMEL-15108](https://issues.apache.org/jira/browse/CAMEL-15108) and @davsclaus can you take a look ?


----------------------------------------------------------------
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:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

[GitHub] [camel-quarkus] jamesnetherton commented on issue #1197: transacted() support in camel-quarkus

GitBox
In reply to this post by GitBox

jamesnetherton commented on issue #1197:
URL: https://github.com/apache/camel-quarkus/issues/1197#issuecomment-651176389


   @zhfeng can we close this now that we have the the JTA extension?


----------------------------------------------------------------
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:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

[GitHub] [camel-quarkus] zhfeng closed issue #1197: transacted() support in camel-quarkus

GitBox
In reply to this post by GitBox

zhfeng closed issue #1197:
URL: https://github.com/apache/camel-quarkus/issues/1197


   


----------------------------------------------------------------
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:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

[GitHub] [camel-quarkus] zhfeng commented on issue #1197: transacted() support in camel-quarkus

GitBox
In reply to this post by GitBox

zhfeng commented on issue #1197:
URL: https://github.com/apache/camel-quarkus/issues/1197#issuecomment-651519959


   yeah, I close.


----------------------------------------------------------------
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:
[hidden email]