ibm-messaging / mq-golang

Calling IBM MQ from Go applications
Apache License 2.0
168 stars 60 forks source link

Transaction Example #214

Open zeconslab opened 3 days ago

zeconslab commented 3 days ago

In a concept of transactionality in multiple queues and handling messages by message, is there an applicable example?

-In summary: I have 1 mq server with 5 queues: If I rollback in one, it is done in all 5 and I only need to handle cmit or rollback per transaction

ibmmqmet commented 3 days ago

MQ manages transaction commit/backout at the connection level. There is no way to change that.

If you want to handle different outcomes per queue, then you would also need one connection per queue. But of course, then those connections are not coordinated among themselves.

the MQBO/MQBEGIN is for when MQ is acting as a transaction coordinator, managing external XA resources such as databases. and that requires you to be running as a locally-connected, not client-connected, application. And it's probably not what you want to use anyway.