Title: JBoss XA transaction with WebSphere MQ

I have been playing with JBoss 3.0.5 and WebSphere MQ 5.3 (ex-MQSeries) for a while now.

I managed to create a new JMS provider in JBoss for WebSphere MQ:

In jms-service.xml, duplicate the org.jboss.jms.jndi.JMSProviderLoader mbean. Change the ProviderName to WebSphereMQJMSProvider, change the QueueFactoryRef to WSMQConnectionFactory (I also changed the TopicFactoryRef to WSMQConnectionFactory, but I did not play with topics). I am passing the details on how to add the WSMQConnectionFactory to the JBoss JNDI space.

I managed to create a new configuration for MDB listening to WS MQ:

In standardjboss.xml, duplicate the Standard Message Driven Bean container configuration. Change the name Standard Message Driven Bean to WebSphere MQ Message Driven Bean and set the JMSProviderAdapterJNDI to WebSphereMQJMSProvider (same as ProviderName in jms-service.xml).

After that, I can have two types of MDBs. One listening to a JBoss queue and one listening to WS MQ queue.

My ultimate goal is to have an MDB listening to a queue X and forward each received messages to a queue Y.
I want X to be a JBoss queue or a WS MQ queue.
I want Y to be a JBoss queue or a WS MQ queue.
I want the reading and forwarding of the message to be done within the same transaction.

If X and Y are JBoss queues, no problem (container transaction-type in the MDB ejb-jar.xml and java:/JmsXA for Y connection factory).

If X is a JBoss queue and Y is a WS MQ queue, I also manage to make it work but with a little more pain:
        - I had to change the JmsProviderAdapterJNDI config property value in the ra.xml of the jms-ra.rar (the JMS resource adapter for XA) in order to point to my WebSphereMQJMSProvider.

        - I had to tweak the JAAS settings of the JMS XA resource adapter in jms-service.xml (WS MQ did not like the default guest/guest user/password used when creating the JMS session)

I have two concerns for this specific case:
        - Is there a simpler way to do that or is it THE way to do it?
        - Let's imagine that I want to forward the message to a second queue - Z - which is not a WS MQ queue. How do I do that since the JMS XA resource adapter seems to work with only one specific connection factory?

Finally, as soon as X is a WS MQ, then the messages are never delivered to my MDB. I am not sure to know why, I am still looking into it. It is really linked to the XA piece (if I use the non XA connection factory of WS MQ and I use <xa-connection>false</xa-connection> in my jboss.xml of the MDB, it is working fine.

Is there anything that I am missing in the MDB configuration when it is used in an XA context? Something similar to what I had to do for the  JMS XA resource adapter?

Any pointers or suggestions on any of those points will be really appreciated.

Thomas


 

Reply via email to