0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Liberty で IBM MQ メッセージング・プロバイダー・アクティベーション・スペックとMQとの接続が切れた場合の再接続の動作

0
Last updated at Posted at 2026-06-01

以下のtWASのときと同じ動作です

以下の環境で実行しています

以下テスト結果

1.MQを停止

2. LibertyではMQ接続が切れる。

最大5回、300000ミリ秒おきに再接続が試行される。
秒数と回数はIBM® MQ リソース・アダプターのプロパティーの構成 - IBM Documentationの下記設定によるもの。

Reconnection retry count
接続が失敗した場合に、 IBM MQ メッセージング・プロバイダー・アクティベーション・スペックが IBM MQ キュー・マネージャーへの再接続を試行する最大回数。

Reconnection retry interval
IBM MQ メッセージング・プロバイダー・アクティベーション・スペックが IBM MQ キュー・マネージャーへの再接続を再試行する前に待機する時間 (ミリ秒)。

WebSphere MQ リソース・アダプター (wmqJmsClient) - IBM Documentation

  • reconnectionRetryCount

int

最小: 0

5

WebSphere MQ キュー・マネージャーへの接続が失敗した場合に再接続するために、リソース・アダプターによって行われる最大試行回数

  • reconnectionRetryInterval

期間 (精度: ミリ秒)

5m

リソース・アダプターが、WebSphere MQ キュー・マネージャーへの再接続を再度試みるまでの待機時間 (ミリ秒単位). 正整数の後に時間単位 (時間 (h)、分 (m)、秒 (s)、またはミリ秒 (ms)) を付けて指定してください。 例えば、500 ミリ秒は 500ms と指定します。 単一エントリーに複数の値を含めることができます。 例えば、1.5 秒の場合、1s500ms とすることができます。


[5/27/26 6:29:50:881 GMT] 00000046 WMQ.commonservices.trace                                     I An exception has been delivered to the connection's exception listener: '
                       Message : com.ibm.msg.client.jms.DetailedIllegalStateException: JMSWMQ1107: A problem with this connection has occurred.
An error has occurred with the IBM MQ JMS connection.
Use the linked exception to determine the cause of this error.
                         Class : class com.ibm.msg.client.jms.DetailedIllegalStateException
                         Stack : com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:489)
                               : com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:215)
                               : com.ibm.msg.client.wmq.internal.WMQConnectionBrowser$WMQConnectionBrowserShadow.consumer(WMQConnectionBrowser.java:712)
                               : com.ibm.mq.jmqi.remote.impl.RemoteProxyQueue.callConsumer(RemoteProxyQueue.java:3784)
                               : com.ibm.mq.jmqi.remote.impl.RemoteDispatchThread.run(RemoteDispatchThread.java:297)
                               : com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.runTask(WorkQueueItem.java:319)
                               : com.ibm.msg.client.commonservices.workqueue.SimpleWorkQueueItem.runItem(SimpleWorkQueueItem.java:99)
                               : com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.run(WorkQueueItem.java:343)
                               : com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.runWorkQueueItem(WorkQueueManager.java:312)
                               : com.ibm.msg.client.commonservices.j2se.workqueue.WorkQueueManagerImplementation$ThreadPoolWorker.run(WorkQueueManagerImplementation.java:1240)
     Caused by [1] --> Message : com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2202' ('MQRC_CONNECTION_QUIESCING').
                         Class : class com.ibm.mq.MQException
                         Stack : com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:203)
                               : com.ibm.msg.client.wmq.internal.WMQConnectionBrowser$WMQConnectionBrowserShadow.consumer(WMQConnectionBrowser.java:712)
                               : com.ibm.mq.jmqi.remote.impl.RemoteProxyQueue.callConsumer(RemoteProxyQueue.java:3784)
                               : com.ibm.mq.jmqi.remote.impl.RemoteDispatchThread.run(RemoteDispatchThread.java:297)
                               : com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.runTask(WorkQueueItem.java:319)
                               : com.ibm.msg.client.commonservices.workqueue.SimpleWorkQueueItem.runItem(SimpleWorkQueueItem.java:99)
                               : com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.run(WorkQueueItem.java:343)
                               : com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.runWorkQueueItem(WorkQueueManager.java:312)
                               : com.ibm.msg.client.commonservices.j2se.workqueue.WorkQueueManagerImplementation$ThreadPoolWorker.run(WorkQueueManagerImplementation.java:1240)
'.
[5/27/26 6:29:50:901 GMT] 00000083 WMQ.commonservices.trace                                     I A connection to a queue manager failed for activationSpec 'jms#jms.war#PdprofMdb'. Check the queue manager error logs for details.
[5/27/26 6:29:50:903 GMT] 00000083 WMQ.commonservices.trace                                     I ActivationSpec 'jms#jms.war#PdprofMdb' is waiting for outstanding work to complete before reconnecting
[5/27/26 6:29:50:909 GMT] 00000083 WMQ.commonservices.trace                                     I A recoverable exception occurred in the JMS layer: 'JMSCMQ0002: The method 'MQCTL' failed.'.
[5/27/26 6:29:50:913 GMT] 00000083 WMQ.commonservices.trace                                     I ActivationSpec 'jms#jms.war#PdprofMdb' is now attempting to reconnect to 'QM1'
[5/27/26 6:29:51:624 GMT] 00000083 WMQ.commonservices.trace                                     I ActivationSpec 'jms#jms.war#PdprofMdb' connect failed due to error 'JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2538' ('MQRC_HOST_NOT_AVAILABLE').'
[5/27/26 6:29:51:642 GMT] 00000084 WMQ.commonservices.trace                                     I Activation specification reconnection attempt '1' of '5'.  Waiting '300000' milliseconds before attempting to reconnect the endpoint 'jms#jms.war#PdprofMdb'.
[5/27/26 6:34:51:751 GMT] 00000084 WMQ.commonservices.trace                                     I Activation specification reconnection attempt '2' of '5'.  Waiting '300000' milliseconds before attempting to reconnect the endpoint 'jms#jms.war#PdprofMdb'.
[5/27/26 6:39:51:878 GMT] 00000084 WMQ.commonservices.trace                                     I Activation specification reconnection attempt '3' of '5'.  Waiting '300000' milliseconds before attempting to reconnect the endpoint 'jms#jms.war#PdprofMdb'.
[5/27/26 6:44:52:017 GMT] 00000084 WMQ.commonservices.trace                                     I Activation specification reconnection attempt '4' of '5'.  Waiting '300000' milliseconds before attempting to reconnect the endpoint 'jms#jms.war#PdprofMdb'.
[5/27/26 6:49:52:151 GMT] 00000084 WMQ.commonservices.trace                                     I Failed to reconnect one or more MDBs after a connection failure.

3.もう一度MQを起動してみる。

WASにはログは出ず、MQを起動するだけではなにも起きない。

4.もう一度MQを止めてみる。

MQに接続していないため、MQを停止してもなにも起きない。

5.MQを起動して、エンドポイントをResume

なにも変わらない。

6.エンドポイントをPauseしてResumeしてみる

Pause実行

$ /opt/ibm/wlp/bin/server pause defaultServer --target=jms#jms.war#PdprofMdb

Resume実行

$ /opt/ibm/wlp/bin/server resume defaultServer --target=jms#jms.war#PdprofMdb

Resumeのログ。メッセージ・エンドポイントとMDBアプリケーションがアクティベートされた。

[5/27/26 7:09:30:068 GMT] 0000001e m.ws.kernel.launch.internal.PauseableComponentControllerImpl I CWWKE0926I: A request was received to resume the following components in the server: jms#jms.war#PdprofMdb
[5/27/26 7:09:30:322 GMT] 0000001e com.ibm.ws.jca.service.EndpointActivationService             I J2CA8801I: The message endpoint for activation specification jms/PdprofMdb and message driven bean application jms#jms.war#PdprofMdb is activated.
[5/27/26 7:09:30:323 GMT] 0000001e m.ws.kernel.launch.internal.PauseableComponentControllerImpl I CWWKE0939I: A resume request completed.

補足。接続試行の最大回数に達する前にMQを起動すると、再接続されました。

3回の試行後にMQを起動

[5/27/26 5:23:54:469 GMT] 000000ab WMQ.commonservices.trace                                     I Activation specification reconnection attempt '1' of '5'.  Waiting '300000' milliseconds before attempting to reconnect the endpoint 'jms#jms.war#PdprofMdb'.
[5/27/26 5:28:54:516 GMT] 000000ab WMQ.commonservices.trace                                     I Activation specification reconnection attempt '2' of '5'.  Waiting '300000' milliseconds before attempting to reconnect the endpoint 'jms#jms.war#PdprofMdb'.
[5/27/26 5:33:54:563 GMT] 000000ab WMQ.commonservices.trace                                     I Activation specification reconnection attempt '3' of '5'.  Waiting '300000' milliseconds before attempting to reconnect the endpoint 'jms#jms.war#PdprofMdb'.

接続された。

[5/27/26 5:38:54:783 GMT] 000000ab WMQ.commonservices.trace                                     I ActivationSpec 'jms#jms.war#PdprofMdb' connected or reconnected (to host '<hostname>/<IP Address>':'1414' - 'QM1') successfully.
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?