ibm-messaging / mq-mqi-nodejs

Calling IBM MQ from Node.js - a JavaScript MQI wrapper
Apache License 2.0
79 stars 42 forks source link

Question: Is there a way to change ACK mode? #139

Closed mike-feldmeier closed 2 years ago

mike-feldmeier commented 2 years ago

This is a fantastic project; thank you for putting it together

Is there a way to specify client acknowledgement instead of auto acknowledgement? I looked through the code and didn't see anything, but then I am far from an expert on MQ internals.

Thanks!

ibmmqmet commented 2 years ago

Client/Auto acknowledgement is primarily a JMS concept, or in some other messaging systems without reliable connectivity.

In the MQI, you use transactions instead to demarcate when you've sucessfully processed something. So use options like MQPMO_SYNCPOINT or MQGMO_SYNCPOINT followed by the mq.Cmit verb.

https://www.ibm.com/docs/en/ibm-mq/9.2?topic=queuing-committing-backing-out-units-work

mike-feldmeier commented 2 years ago

In the past I've only approached it through JMS, so this is something new to learn. Thank you very much for your explanation!