is transaction (required) by default enabled for the route sending message from one jms endpoint to another endpoint

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

is transaction (required) by default enabled for the route sending message from one jms endpoint to another endpoint

nono
is transaction (required) by default enabled for the route sending message
from one jms endpoint to another endpoint like below

 from("activemq:queue:foo").to("activemq:queue:bar");

or i have to explicitly do like  below ?
Policy requried = bean(SpringTransactionPolicy.class,
"PROPAGATION_REQUIRED"));
 from("activemq:queue:foo").policy(required).to("activemq:queue:bar");

Any hints or suggestions are more than welcome!
Reply | Threaded
Open this post in threaded view
|

Re: is transaction (required) by default enabled for the route sending message from one jms endpoint to another endpoint

Willem.Jiang
Administrator
As the transaction is bit complicated, you need to setup the
transaction manager yourself on the jms component first, then you can
apply the policy. So I don't think we can provide the transaction
policy out of box.

Please check out this document[1] for more information about setting
the transaction policy between the jms component.

[1]https://github.com/apache/camel/blob/master/camel-core/src/main/docs/eips/transactional-client.adoc

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem
On Sun, Oct 21, 2018 at 2:27 PM Wang Yan <[hidden email]> wrote:

>
> is transaction (required) by default enabled for the route sending message
> from one jms endpoint to another endpoint like below
>
>  from("activemq:queue:foo").to("activemq:queue:bar");
>
> or i have to explicitly do like  below ?
> Policy requried = bean(SpringTransactionPolicy.class,
> "PROPAGATION_REQUIRED"));
>  from("activemq:queue:foo").policy(required).to("activemq:queue:bar");
>
> Any hints or suggestions are more than welcome!