views:

115

answers:

1

I’m writing a client that receives messages from an external Websphere MQ Queue and puts them on an internal MSMQ Queue. The client will use MQ Client or, preferably, be purely managed (MQC.TRANSPORT_MQSERIES_MANAGED).

Based on an example from IBM, I have a version up and running that can do a simple IBM.WMQ.MQQueue.Get(…). How can this operation be done within a transaction? I'm thinking of using non-XA transactions.

+1  A: 

The WMQ Single-Phase Commit is enabled by using the MQC.MQPMO_SYNCPOINT flag when putting messages or the MQC.MQGMO_SYNCPOINT flag when getting messages. To complete the unit of work, call the queue manager object's Commit or Backout method.

Reference: the Backout and Commit methods in the MQQueueManager section in the manual.

As long as you are using managed code you are limited to 1-phase commit. If using unmanaged code in bindings mode (using shared memory to talk to a local WMQ QMgr) you can use XA. In that case you'd need to use the Begin method.

T.Rob