Websphere MQ 7.0.1 C# XMS 连接导致 10054 (X'2746') tcp 错误
我有一个连接到远程队列管理器的简单程序,该程序似乎工作正常,并且我可以发送和接收消息。但是我注意到,每次连接时,我都会在 Windows 应用程序事件管理器中收到错误:
从主机 myhost (12.213.143.252) 接收时出错。
从我的主机(12.213.143.252)接收数据时发生错误 TCP/IP。这可能是由于通信故障造成的。
TCP/IP recv() 调用的返回码是 10054 (X'2746')。 记录这些值并告诉系统管理员。
我认为这可能是因为我没有正确地在客户端断开连接,尽管我不确定我做错了什么。这是我用来测试连接的代码,该代码仍然导致此问题:
XMSFactoryFactory factoryFactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);
IConnectionFactory cf = factoryFactory.CreateConnectionFactory();
cf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, WebSphereConfigObject.QueueManager);
cf.SetStringProperty(XMSC.WMQ_HOST_NAME, WebSphereConfigObject.Host);
cf.SetIntProperty(XMSC.WMQ_PORT, WebSphereConfigObject.Port);
cf.SetStringProperty(XMSC.WMQ_CHANNEL, WebSphereConfigObject.ServerConnectionChannel);
cf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);
IConnection connection = cf.CreateConnection();
ISession session = connection.CreateSession(false, AcknowledgeMode.AutoAcknowledge);
connection.Start();
session.Close();
connection.Stop();
connection.Close();
非常感谢任何帮助!
I have a simple program connecting to a remote queue manager which seems to work fine and I can send and receive messages. However I have noticed that with every connection I am getting errors in the windows application event manager:
Error on receive from host myhost (12.213.143.252).
An error occurred receiving data from my host(12.213.143.252) over
TCP/IP. This may be due to a communications failure.The return code from the TCP/IP recv() call was 10054 (X'2746').
Record these values and tell the systems administrator.
I thought this might be that I am not disconnecting on the client side correctly though I'm not sure what I am doing wrong. Here is the code I am using to test connecting which is still causing this issue:
XMSFactoryFactory factoryFactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);
IConnectionFactory cf = factoryFactory.CreateConnectionFactory();
cf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, WebSphereConfigObject.QueueManager);
cf.SetStringProperty(XMSC.WMQ_HOST_NAME, WebSphereConfigObject.Host);
cf.SetIntProperty(XMSC.WMQ_PORT, WebSphereConfigObject.Port);
cf.SetStringProperty(XMSC.WMQ_CHANNEL, WebSphereConfigObject.ServerConnectionChannel);
cf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);
IConnection connection = cf.CreateConnection();
ISession session = connection.CreateSession(false, AcknowledgeMode.AutoAcknowledge);
connection.Start();
session.Close();
connection.Stop();
connection.Close();
any help much appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据我所知,事件 10054 由队列管理器进程 amqrmppa 记录。当此队列管理器进程与 XMS 客户端应用程序之间的套接字连接突然终止时,将记录该事件。
正常终止不会记录任何事件。
From what I have seen that event 10054 is logged by a queue manager process, amqrmppa. The event is logged when socket connection between this queue manager process and the XMS client application terminates abruptly.
Normal termination does not log any event.
尽量不要使用这两个 .close 调用!
s。 [1]: http://www-01.ibm.com/support /docview.wss?uid=swg27024064
正确关闭和断开连接
编写应用程序以正确关闭或处置不再使用的 XMS 对象。如果不这样做,尤其是 IConnection 或 ISession 实例,可能会限制与队列管理器的连接数量。
Try to not use the both .close calls !!!
s. [1]: http://www-01.ibm.com/support/docview.wss?uid=swg27024064
Close and disconnect connections properly
Code applications to properly close or dispose XMS objects that are no longer used. Failure to do so, especially IConnection or ISession instances, may limit the number connections to a queue manager.