3

JMSキューに接続しています。キューは、SIBusを使用してWebSphere Application Server(バージョン8.0.0.5)によってホストされます。

問題のある動作を再現する簡単なプログラムがあります。これはC#で記述されており、XMS(IBMの.NET API)を使用してキューに接続します。:ここからIBM.XMS dllを入手しました:MQC71:WebSphereMQV7.1クライアント

シナリオは次のとおりです。

  1. プログラムを実行します(空のキューを使用して、ブロックされている受信呼び出しを待機します)
  2. ネットワークを切断します(イーサネットのプラグを抜きます)
  3. 数分後、Receive呼び出しは例外をスローします
  4. プログラムは新たに接続を試みます
  5. ネットワークがダウンしているため、これは失敗します
  6. ...このエラーが引き続き発生することを確認するために、少しループさせます
  7. ネットワークを復元します(イーサネットを接続します)
  8. 同じエラーが引き続き発生します(connectionFactory.CreateConnection()呼び出し中にネットワークトラフィックが発生しないことがWireSharkで確認されました)

したがって、問題は、CreateConnection()呼び出しが何もしない(パケットを送信しない)のに失敗するのはなぜですか?

using IBM.XMS;
using System;

namespace SimpleTest
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                try
                {
                    string queueURI = "queue://your.details.GoHereDearReader";
                    string providerEndpoint = "1.2.3.4:1234";
                    string targetTransportChain = "InboundBasicMessaging";
                    string busName = "some_bus_name";

                    XMSFactoryFactory factoryFactory = XMSFactoryFactory.GetInstance(XMSC.CT_WPM);
                    IConnectionFactory connectionFactory = factoryFactory.CreateConnectionFactory();
                    connectionFactory.SetStringProperty(XMSC.WPM_PROVIDER_ENDPOINTS, providerEndpoint);
                    connectionFactory.SetStringProperty(XMSC.WPM_TARGET_TRANSPORT_CHAIN, targetTransportChain);
                    connectionFactory.SetStringProperty(XMSC.WPM_BUS_NAME, busName);

                    Log("Connecting...");
                    using (var connection = connectionFactory.CreateConnection())
                    {
                        using (var session = connection.CreateSession(false, AcknowledgeMode.AutoAcknowledge))
                        {
                            using (var destination = session.CreateQueue(queueURI))
                            {
                                destination.SetIntProperty(XMSC.DELIVERY_MODE, XMSC.DELIVERY_NOT_PERSISTENT);
                                connection.Start();

                                using (IMessageConsumer consumer =  session.CreateConsumer(destination))
                                {
                                    Log("Receiving...");
                                    IMessage recvMsg = consumer.Receive();
                                    Log("recvMsg:" + recvMsg);
                                }
                            }
                        }
                    }
                }
                catch (Exception e)
                {
                    Log(e.ToString());
                }
                Log("Sleeping some before consuming more...");
                System.Threading.Thread.Sleep(10 * 1000);
            }//while
        }//Main

        static void Log(string text)
        {
            Console.WriteLine(DateTime.UtcNow.ToString("HH:mm:ss.fff") + "--------------------------  " + text);
        }

    }
}

そしていくつかの出力:

16:38:19.483--------------------------  Connecting...
16:38:19.936--------------------------  Receiving...
16:43:31.952--------------------------  IBM.XMS.XMSException: EXCEPTION_RECEIVED_CWSIA0022
EXCEPTION_RECEIVED_CWSIA0022.explanation
EXCEPTION_RECEIVED_CWSIA0022.useraction
   at IBM.XMS.Impl.Connection.Dispose(Boolean disposing)
   at IBM.XMS.Impl.Connection.Dispose()
   at SimpleTest.Program.Main(String[] args) in c:\Users\Administrator\Documents\Visual Studio Projects\TestJMSDequeue\SimpleTest\Program.cs:line 43

Linked Exception : IBM.XMS.SIB.JFAP.JFapConversationClosedException: Exception of type 'IBM.XMS.SIB.JFAP.JFapConversationClosedException' was thrown.
   at IBM.XMS.SIB.JFAP.ConversationImpl.Send(IByteBuffer[] data, JFAPSegmentType segmentType, UInt16 requestNumber, IoPriority priority, Boolean pooledBufferHint, IReceiveListener recvListener, ISendListener sendListener, Object state)
   at IBM.XMS.SIB.JFAP.ConversationImpl.RequestReplyExchange(IByteBuffer[] data, JFAPSegmentType segmentType, UInt16 requestNumber, IoPriority priority, Boolean pooledBufferHint)
   at IBM.XMS.SIB.JFAP.ConversationImpl.RequestReplyExchange(IByteBuffer data, JFAPSegmentType segmentType, UInt16 requestNumber, IoPriority priority, Boolean pooledBufferHint)
   at IBM.XMS.SIB.Comms.Client.JFAPCommunicator.RequestReplyExchange(IByteBuffer data, JFAPSegmentType sendSegType, MessagePriority priority, Boolean canPoolOnReceive)
   at IBM.XMS.SIB.Comms.Client.ConnectionProxy.Close()
   at IBM.XMS.Impl.Connection.Dispose(Boolean disposing)
16:43:31.952--------------------------  Sleeping some before consuming more...
16:43:41.967--------------------------  Connecting...
Exception  : System.InvalidOperationException: UniqueLinkObject no seen on handshake.
   at IBM.XMS.Formats.MFP.SIB.SchemaManager.SendSchemas(ICommsConnection connection, JMFSchema[] schemas)
   at IBM.XMS.Formats.MFP.SIB.JsMsgObject.Encode(Object connection)
FFDC to xmsffdc8416_2013.03.08T10.43.41.967444.txt
Exception  : IBM.XMS.Formats.MFP.MessageEncodeFailedException: Exception of type 'IBM.XMS.Formats.MFP.MessageEncodeFailedException' was thrown. ---> System.InvalidOperationException: UniqueLinkObject no seen on handshake.
   at IBM.XMS.Formats.MFP.SIB.SchemaManager.SendSchemas(ICommsConnection connection, JMFSchema[] schemas)
   at IBM.XMS.Formats.MFP.SIB.JsMsgObject.Encode(Object connection)
   --- End of inner exception stack trace ---
   at IBM.XMS.Formats.MFP.SIB.JsMsgObject.Encode(Object connection)
   at IBM.XMS.Formats.MFP.SIB.TrmFirstContactMessageImpl.Encode(Object connection)
   at IBM.XMS.SIB.Trm.ClientBootstrapHandler.Connect(IClientConnection clientConnection)
FFDC to xmsffdc8416_2013.03.08T10.43.41.983044.txt
16:43:41.983--------------------------  IBM.XMS.XMSException: EXCEPTION_RECEIVED_CWSIA0241
EXCEPTION_RECEIVED_CWSIA0241.explanation
EXCEPTION_RECEIVED_CWSIA0241.useraction
   at IBM.XMS.Impl.ConnectionFactory.CreateConnection(String userName, String password)
   at IBM.XMS.Impl.ConnectionFactory.CreateConnection()
   at SimpleTest.Program.Main(String[] args) in c:\Users\Administrator\Documents\Visual Studio Projects\TestJMSDequeue\SimpleTest\Program.cs:line 26

Linked Exception : IBM.XMS.Core.SIResourceException: CWSIT0006E: It is not possible to connect to bus your_bus_name_here because the following bootstrap servers could not be contacted  1.2.3.4:1234:BootstrapBasicMessaging and the following bootstrap servers returned an error condition . See previous messages for the reason for each bootstrap server failure.
The client cannot connect to the bus. This situation may be due to configuration problems, network problems or it may be that none of the required bootstrap servers or messaging engines are currently available.
Ensure that the network is working correctly and that the required bootstrap servers and messaging engines are available. ---> IBM.XMS.Core.SIConnectionLostException: Exception of type 'IBM.XMS.Core.SIConnectionLostException' was thrown.
   at IBM.XMS.SIB.Comms.Client.ClientSideConnection.Connect(ConnectionProperties cp, IClientComponentHandshake cch, SICoreConnectionProperties siProps)
   at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactoryImpl.Bootstrap(Credentials credentials, SICoreConnectionProperties connectionProperties, ClientAttachProperties cap)
   --- End of inner exception stack trace ---
   at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactoryImpl.Bootstrap(Credentials credentials, SICoreConnectionProperties connectionProperties, ClientAttachProperties cap)
   at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactoryImpl.CreateConnection(Credentials credentials, SICoreConnectionProperties connectionProperties)
   at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactory.CreateConnection(String username, String password, SICoreConnectionProperties connectionProperties)
   at IBM.XMS.Impl.ConnectionFactory.CreateConnection(String userName, String password)
16:43:41.983--------------------------  Sleeping some before consuming more...
16:43:51.998--------------------------  Connecting...
Exception  : System.InvalidOperationException: UniqueLinkObject no seen on handshake.
   at IBM.XMS.Formats.MFP.SIB.SchemaManager.SendSchemas(ICommsConnection connection, JMFSchema[] schemas)
   at IBM.XMS.Formats.MFP.SIB.JsMsgObject.Encode(Object connection)
FFDC to xmsffdc8416_2013.03.08T10.43.51.998262.txt
Exception  : IBM.XMS.Formats.MFP.MessageEncodeFailedException: Exception of type 'IBM.XMS.Formats.MFP.MessageEncodeFailedException' was thrown. ---> System.InvalidOperationException: UniqueLinkObject no seen on handshake.
   at IBM.XMS.Formats.MFP.SIB.SchemaManager.SendSchemas(ICommsConnection connection, JMFSchema[] schemas)
   at IBM.XMS.Formats.MFP.SIB.JsMsgObject.Encode(Object connection)
   --- End of inner exception stack trace ---
   at IBM.XMS.Formats.MFP.SIB.JsMsgObject.Encode(Object connection)
   at IBM.XMS.Formats.MFP.SIB.TrmFirstContactMessageImpl.Encode(Object connection)
   at IBM.XMS.SIB.Trm.ClientBootstrapHandler.Connect(IClientConnection clientConnection)
FFDC to xmsffdc8416_2013.03.08T10.43.51.998262.txt
16:43:51.998--------------------------  IBM.XMS.XMSException: EXCEPTION_RECEIVED_CWSIA0241
EXCEPTION_RECEIVED_CWSIA0241.explanation
EXCEPTION_RECEIVED_CWSIA0241.useraction
   at IBM.XMS.Impl.ConnectionFactory.CreateConnection(String userName, String password)
   at IBM.XMS.Impl.ConnectionFactory.CreateConnection()
   at SimpleTest.Program.Main(String[] args) in c:\Users\Administrator\Documents\Visual Studio Projects\TestJMSDequeue\SimpleTest\Program.cs:line 26

Linked Exception : IBM.XMS.Core.SIResourceException: CWSIT0006E: It is not possible to connect to bus your_bus_name_here because the following bootstrap servers could not be contacted  1.2.3.4:1234:BootstrapBasicMessaging and the following bootstrap servers returned an error condition . See previous messages for the reason for each bootstrap server failure.
The client cannot connect to the bus. This situation may be due to configuration problems, network problems or it may be that none of the required bootstrap servers or messaging engines are currently available.
Ensure that the network is working correctly and that the required bootstrap servers and messaging engines are available. ---> IBM.XMS.Core.SIConnectionLostException: Exception of type 'IBM.XMS.Core.SIConnectionLostException' was thrown.
   at IBM.XMS.SIB.Comms.Client.ClientSideConnection.Connect(ConnectionProperties cp, IClientComponentHandshake cch, SICoreConnectionProperties siProps)
   at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactoryImpl.Bootstrap(Credentials credentials, SICoreConnectionProperties connectionProperties, ClientAttachProperties cap)
   --- End of inner exception stack trace ---
   at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactoryImpl.Bootstrap(Credentials credentials, SICoreConnectionProperties connectionProperties, ClientAttachProperties cap)
   at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactoryImpl.CreateConnection(Credentials credentials, SICoreConnectionProperties connectionProperties)
   at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactory.CreateConnection(String username, String password, SICoreConnectionProperties connectionProperties)
   at IBM.XMS.Impl.ConnectionFactory.CreateConnection(String userName, String password)
16:43:51.998--------------------------  Sleeping some before consuming more...
16:44:02.013--------------------------  Connecting...
Exception  : System.InvalidOperationException: UniqueLinkObject no seen on handshake.
   at IBM.XMS.Formats.MFP.SIB.SchemaManager.SendSchemas(ICommsConnection connection, JMFSchema[] schemas)
   at IBM.XMS.Formats.MFP.SIB.JsMsgObject.Encode(Object connection)
FFDC to xmsffdc8416_2013.03.08T10.44.02.013479.txt
Exception  : IBM.XMS.Formats.MFP.MessageEncodeFailedException: Exception of type 'IBM.XMS.Formats.MFP.MessageEncodeFailedException' was thrown. ---> System.InvalidOperationException: UniqueLinkObject no seen on handshake.
   at IBM.XMS.Formats.MFP.SIB.SchemaManager.SendSchemas(ICommsConnection connection, JMFSchema[] schemas)
   at IBM.XMS.Formats.MFP.SIB.JsMsgObject.Encode(Object connection)
   --- End of inner exception stack trace ---
   at IBM.XMS.Formats.MFP.SIB.JsMsgObject.Encode(Object connection)
   at IBM.XMS.Formats.MFP.SIB.TrmFirstContactMessageImpl.Encode(Object connection)
   at IBM.XMS.SIB.Trm.ClientBootstrapHandler.Connect(IClientConnection clientConnection)
FFDC to xmsffdc8416_2013.03.08T10.44.02.013479.txt
16:44:02.013--------------------------  IBM.XMS.XMSException: EXCEPTION_RECEIVED_CWSIA0241
EXCEPTION_RECEIVED_CWSIA0241.explanation
EXCEPTION_RECEIVED_CWSIA0241.useraction
   at IBM.XMS.Impl.ConnectionFactory.CreateConnection(String userName, String password)
   at IBM.XMS.Impl.ConnectionFactory.CreateConnection()
   at SimpleTest.Program.Main(String[] args) in c:\Users\Administrator\Documents\Visual Studio Projects\TestJMSDequeue\SimpleTest\Program.cs:line 26

Linked Exception : IBM.XMS.Core.SIResourceException: CWSIT0006E: It is not possible to connect to bus your_bus_name_here because the following bootstrap servers could not be contacted  1.2.3.4:1234:BootstrapBasicMessaging and the following bootstrap servers returned an error condition . See previous messages for the reason for each bootstrap server failure.
The client cannot connect to the bus. This situation may be due to configuration problems, network problems or it may be that none of the required bootstrap servers or messaging engines are currently available.
Ensure that the network is working correctly and that the required bootstrap servers and messaging engines are available. ---> IBM.XMS.Core.SIConnectionLostException: Exception of type 'IBM.XMS.Core.SIConnectionLostException' was thrown.
   at IBM.XMS.SIB.Comms.Client.ClientSideConnection.Connect(ConnectionProperties cp, IClientComponentHandshake cch, SICoreConnectionProperties siProps)
   at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactoryImpl.Bootstrap(Credentials credentials, SICoreConnectionProperties connectionProperties, ClientAttachProperties cap)
   --- End of inner exception stack trace ---
   at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactoryImpl.Bootstrap(Credentials credentials, SICoreConnectionProperties connectionProperties, ClientAttachProperties cap)
   at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactoryImpl.CreateConnection(Credentials credentials, SICoreConnectionProperties connectionProperties)
   at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactory.CreateConnection(String username, String password, SICoreConnectionProperties connectionProperties)
   at IBM.XMS.Impl.ConnectionFactory.CreateConnection(String userName, String password)
16:44:02.013--------------------------  Sleeping some before consuming more...

上記の出力では、「Receiving ...」の直後にネットワークを切断し、16:43:52に再度接続しましたが、その後、プログラムを強制終了するまでエラーが続いたことに注意してください。

4

2 に答える 2