public static JtaTransactionManager configureJTATxnMgr(final JndiRegistry
registry) {
    if (null == registry) throw new NullPointerException("registry");
    // -- Set Transaction manager because we will be using transacted();
note that this will find the correct one on the host platform.
    final JtaTransactionManager txnMgr = new JtaTransactionManager();
    registry.bind(KEY_TXNMANAGER, txnMgr);
    bindTransactionPolicies(txnMgr, registry);
    return txnMgr;
  }

We use that code in EAP 6.1.

Also note you will have to do setTransacted(false) on the JMS component.
Its counterintuitive. The method should be named
setLocalTransactions(false). If you don't do that it wont work.


*Robert Simmons Jr. MSc. - Lead Java Architect @ EA*
*Author of: Hardcore Java (2003) and Maintainable Java (2012)*
*LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39
<http://www.linkedin.com/pub/robert-simmons/40/852/a39>*


On Wed, Jun 4, 2014 at 9:09 AM, Willem Jiang <willem.ji...@gmail.com> wrote:

> Hi,
>
> Camel route transaction support is based on Spring transaction.
> You can enable the transaction support in camel-jms component, but I don’t
> think the camel route can support transaction without using spring.
>
> --
> Willem Jiang
>
> Red Hat, Inc.
> Web: http://www.redhat.com
> Blog: http://willemjiang.blogspot.com (English)
> http://jnn.iteye.com (Chinese)
> Twitter: willemjiang
> Weibo: 姜宁willem
>
>
>
> On June 2, 2014 at 9:56:45 PM, Anders Bohn Jespersen (a...@miracle.dk)
> wrote:
> > We are running Apache Camel inside a Redhat EAP/JBoss AS7 using CDI to
> setup the context
> > - from http://camel.apache.org/cdi.html.
> >
> > This works fine, but since we use EJB's and MDB's as well, we need
> transactional routes.
> >
> > Looking at http://camel.apache.org/transactional-client.html, this
> seems to require
> > Spring, which should be configured to use the JBoss JTA transaction
> manager.
> >
> > I can get the TM from the container via JNDI, but it is not clear, how
> to register it with
> > the camelContext without spring.
> >
> > Nor to combine CDI-camel-context + RouteBuilder +
> Spring-bean-registration.
> >
> >
> > Any pointers are much appreciated.
> >
> >
> > Med venlig hilsen
> > -----------
> > Anders Bohn Jespersen
> > a...@miracle.dk
> > +45 5374 7251
> >
> >
> >
> >
> >
> >
>
>

Reply via email to