XMS.NET无限期地挂在factory.CreateConnection("username",null)上; [英] XMS.NET hanging indefinitely on factory.CreateConnection("username", null);

查看:163
本文介绍了XMS.NET无限期地挂在factory.CreateConnection("username",null)上;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用.NET客户端连接到现有的JMS队列. 我知道队列正在工作,我已经使用IBM MQ Explorer浏览了它.

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.

在下面的代码中,对factory.CreateConnection的调用一直处于挂起状态-它不会跳到下一行,in中不会显示任何错误消息.它甚至不消耗任何CPU.

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);
    }

主要方法如下:

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

推荐答案

我看不到您的代码有任何问题,使用MQ v8对其进行了测试并可以正常工作.我建议您这样做:

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也可以在非托管模式下运行.因此,更改

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

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

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

看看是否有帮助.

2)调用挂起时,进入调试状态并查看调用堆栈以确定挂起点.如果不消耗任何CPU,它可能正在等待某个系统事件.

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)使用IBM打开PMR.

3) Open a PMR with IBM.

这篇关于XMS.NET无限期地挂在factory.CreateConnection("username",null)上;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆