2013-03-08 5 views
3

Я подключаюсь к очереди JMS. Очередь размещена WebSphere Application Server (версия 8.0.0.5) с использованием SIBus.XMS - как восстановить соединение с WebSphere SIBus после сбоя сети

У меня есть простая программа для воспроизведения некоторого проблемного поведения, она написана на C# и использует XMS (IBM .NET API) для подключения к очереди. Примечание: Я получил DLLs IBM.XMS отсюда: MQC71: WebSphere MQ V7.1 Clients

Сценарий таков:

  1. запустить программу (с помощью пустой очереди, так что он сидит в ожидании на блокирующем Прием вызова)
  2. отключение сети (отключите Ethernet)
  3. через несколько минут, получающий вызов бросает исключение
  4. программы пытается подключиться заново
  5. это не удается из-за сети время вниз
  6. ... зациклить немного, чтобы проверить эту ошибку постоянно происходит
  7. восстановить сеть (подключаемый модуль в сети Ethernet)
  8. та же ошибка продолжает возникать (проверено с WireShark что нет сетевого трафика не происходит во время connectionFactory.CreateConnection (вызов))

Итак, вопрос: почему не делает 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... 

Обратите внимание, что в приведенном выше выводе я отключил сеть вскоре после того, как «Получение ...» и подключить его снова в 16:43:52, но ошибки продолжались после этого, пока я не убил программу.

ответ

0

Он читается, как ConnectionFactory не сбрасывает его состояние должным образом, когда сеть становится доступной снова.

Я проверил справочное руководство для любого намека на функцию сброса на заводе-изготовителе, но havn't нашел его. Я бы попробовал это, однако: Переместите GetInstance(...) и createConnectionFactory() вне петли, а также линии SetStringProperty().

Если это не работает, я не понимаю, почему ваш клиент не работает. Считаете ли вы, что это проблема с сервером? Какой кабель Ethernet вы отключили? тот, который подключен к клиенту или серверу? Если это сервер, возникает ли такая же проблема при отключении кабеля клиента? Если вы перезапустите программу, тогда она будет работать?

+0

После перезагрузки программа подключается к очереди в порядке. Я отключил сетевой кабель, соединяющий клиента с сетью. – Anssssss

+0

Тогда либо предложение перемещать некоторые строки вне цикла должно работать - или похоже, что это скорее всего ошибка в структуре. – fredrik

+0

Я попробовал ваше предложение (перемещение создания и инициализация connectionFactory за пределами цикла). Это же условие ошибки. Обратите внимание, что я принимаю отчет об ошибке с IBM как достаточный ответ, если у вас есть учетная запись клиента в IBM и ее можно создать. Если нет обходного пути/исправления, я начну изучать, как выгружать/перезагружать библиотеки XMS (надеясь, что это эквивалентно перезапуску приложения). – Anssssss

0

Я знаю, что это старый пост, но, возможно, он по-прежнему будет полезен.

Эта ошибка возникает после того, как вы создали 65.535 соединений. Не важно, закрываете ли вы соединение/удаляете объект.

Я вижу следующие решения:

1.) Вы можете создать соединение один раз и повторно использовать соединение для всех своих операций в очереди, пока соединение не сломается. Затем вам нужно снова подключиться. (да, это плохо и против общих моделей. Я бы не советовал это делать)

2.) Есть исправление для версии 8.0.0.6. EDIT: APAR # (IJ01244) Я еще не знаю, когда он будет включен в будущие выпуски. Я думаю, вы можете обратиться в службу поддержки IBM и обратиться к этому PMR ID, чтобы получить обновленную версию IBM.XMS.SIB.dll

Надеюсь, это поможет.

Смежные вопросы