1 Reply Latest reply: Nov 2, 2010 4:25 AM by nigeldeakin RSS

    How to change OpenMQ usage from stand-alone to JTA (Atomikos impl)

    809569
      Hi,
      I have a module which is run in Tomcat and up until now used OpenMQ as stand-alone.
      I now have the need to use distributed transactions (JMS,Hibernate,EHCache) and I want to know what I need to do to switch over from my current config to JTA.
      Also, apart from the configurations, I'd like to understand; Will, in JTA mode, OpenMQ be handling the ConnectionFactories and the Connections? If so, how does that affect my code? Where do I obtain the session? If it's not true, how do these independent creatures created by me interact with the JTA Transaction?

      Most tutorials I was able to find involved either a J2EE app server or spring (or both) and I am currently reluctant to add any more components so I'd appreciate your feedback.

      Ittai
        • 1. Re: How to change OpenMQ usage from stand-alone to JTA (Atomikos impl)
          nigeldeakin
          Ittai,

          This is really a question about the capabilities of Tomcat.

          Open Message Queue supports the standard JMS API necessary to participate in distributed (JTA) transactions (e.g. javax.jms.XAConnection, javax.transaction.xa .XAResource etc). This API is intended for use by resource adapters and application servers rather than directly by the user application.

          Some application servers are able to use this API directly, whilst others require the use of a JCA resource adapter.

          There are several resource adapters which can be used with Open Message Queue: There's one bundled with MQ though this is really intended for use only with GlassFish. There's also GenericJMSRA which is intended for use with any application server that supports JCA resource adapters.

          So you need an application server that either supports the JMS API for distributed transactions directly, or which supports JCA resource adapters. Any JavaEE application server (including GlassFish, of which Open Message Queue is part), will support the latter.

          Nigel