zatosource / zato

ESB, SOA, REST, APIs and Cloud Integrations in Python
https://zato.io
GNU Affero General Public License v3.0
1.12k stars 240 forks source link

IBM MQ channel, reconnect problem #1037

Closed fenist19 closed 4 years ago

fenist19 commented 4 years ago

Hi. We use zato with ibm mq, and have next problem. If connection with mq server lost, zato raise exception and stop channel. Channel retry connection only after restart cahnnel. The error was emulated in the zato assembly with the mq server, reloading the container with it. the error raise in next functions.

After restart server zato raise

pymqi.MQMIError: MQI Error. Comp: 2, Reason 2161: FAILED: MQRC_Q_MGR_QUIESCING

https://github.com/zatosource/zato/blob/main/code/zato-server/src/zato/server/connection/connector/subprocess_/impl/ibm_mq.py#L153 reconnect not raise. if I add this error to except, next raise in https://github.com/zatosource/zato/blob/ed49f04ab4fd05ef623af9abe282684ab58e69fc/code/zato-server/src/zato/server/connection/jms_wmq/jms/connection.py#L226 Traceback (most recent call last): File "/opt/zato_dir/zato/code/zato-server/src/zato/server/connection/jms_wmq/jms/connection.py", line 279, in connect password=self.password, **kwargs) File "/opt/zato_dir/zato/code/lib/python3.6/site-packages/pymqi/init.py", line 1347, in connect_with_options raise MQMIError(rv[1], rv[2]) pymqi.MQMIError: MQI Error. Comp: 2, Reason 2538: FAILED: MQRC_HOST_NOT_AVAILABLE

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/zato_dir/zato/code/zato-server/src/zato/server/connection/jms_wmq/jms/connection.py", line 230, in reconnect self.connect() File "/opt/zato_dir/zato/code/zato-server/src/zato/server/connection/jms_wmq/jms/connection.py", line 283, in connect raise exc zato.server.connection.jms_wmq.jms.WebSphereMQException: MQI Error. Comp: 2, Reason 2538: FAILED: MQRC_HOST_NOT_AVAILABLE

and after this channel did't reconnect. restart server time about 10 sec. I think that, solution to the problem it is while cycle in https://github.com/zatosource/zato/blob/ed49f04ab4fd05ef623af9abe282684ab58e69fc/code/zato-server/src/zato/server/connection/jms_wmq/jms/connection.py#L226

and option in web admin with max retry time and try reconnect after 5 or 10 seconds. Can you help with this problem?

P.S. this problem also with rabbit mq channel.