ibm-messaging / mq-mqi-nodejs

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

Always check if the GetLoop needs to be reset #140

Closed scagood closed 2 years ago

scagood commented 2 years ago

Please ensure all items are complete before opening.

What

When calling GetDone always check if the GetLoop needs to be reset.

How

If the server is hard closed we get the following error: GET: MQCC = MQCC_FAILED [2] MQRC = MQRC_CONNECTION_BROKEN [2009]

When trying to gracefully handle the reconnection and then restart the Get, the poll is never restarted.

The log of a failure to restart the polling is here (I added comments and tried to break the log up for easy reading): https://gist.github.com/scagood/17d390765af4746dded9c1ed22b45dfa#file-ibmmq-not-resuming-log

Testing

After patching my local node_modules everything resumed as expected: https://gist.github.com/scagood/17d390765af4746dded9c1ed22b45dfa#file-ibmmq-resuming-log

scagood commented 2 years ago

If this is not the correct solution to this problem please do point in roughly the correct direction :grin:

ibmmqmet commented 2 years ago

This looks good. Thanks both for the fix and the really detailed problem report and tracing. It makes it much easier to review,