XMS.NET hanging indefinitely on factory.CreateConnection(“username”, null);

梦想与她 提交于 2020-01-06 03:35:28

问题


I am trying to connect to an existing JMS queue with a .NET client. I know the queue is working, I already browsed it using IBM MQ Explorer.

In the following code, the call to factory.CreateConnection keeps hanging - it does not jump to the next line, in does not show any error message. It even doesnt consume any CPU.

Are there any options that I should try to get it working (or at least make it show me an error message of any kind)?

private static IConnectionFactory GetConnectionFactory()
    {
        var factoryFactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);
        var cf = factoryFactory.CreateConnectionFactory();

        cf.SetStringProperty(XMSC.WMQ_HOST_NAME, "server address");
        cf.SetIntProperty(XMSC.WMQ_PORT, portnumber);
        cf.SetStringProperty(XMSC.WMQ_CHANNEL, "channelname");
        cf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);
        cf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, "queuemanager");
        cf.SetIntProperty(XMSC.WMQ_BROKER_VERSION, XMSC.WMQ_BROKER_UNSPECIFIED);

        return (cf);
    }

The main method has the following:

var factory = GetConnectionFactory();
var connection = factory.CreateConnection("username", null);

回答1:


I don't see any problem with your code, tested it with MQ v8 and works fine. I would suggest you to do:

1) XMS can run in unmanaged mode also. So change

cf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);

to

cf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT_UNMANAGED)

and see if that helps.

2) When the call hangs, break into debug and see the call stack to determine the point of hang. It could be waiting on some system event if no CPU is being consumed.

3) Open a PMR with IBM.



来源:https://stackoverflow.com/questions/31044783/xms-net-hanging-indefinitely-on-factory-createconnectionusername-null

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!