ActiveMQ NMS:当代理关闭时,connection.start()与故障转移协议一起挂起 [英] ActiveMQ NMS: connection.start() hangs with Failover protocol when broker is down

查看:193
本文介绍了ActiveMQ NMS:当代理关闭时,connection.start()与故障转移协议一起挂起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有使用nms.activemq 1.5.0的C#应用​​程序。



当我的应用程序启动时,它尝试使用故障转移协议连接到代理(我有两个代理)主从配置)。

如果由于 connection.start()而使我的应用程序停滞不前,则

我尝试了在网络上找到的所有信息-我尝试了故障转移协议的每个属性,还尝试了设置连接超时,尝试了 transport.requesttimeout



我还尝试了nms.activemq的较新版本,但似乎没有任何解决办法。



任何想法会导致此问题或任何解决方法的原因是什么?

解决方案

在挖掘Google结果后,我发现此线程



<蒂姆·比什(Tim Bish)向开发人员回答说,在NMS中需要添加到所有运输属性中的前缀 transport。*



我原来的uri是:

  failover://(tcp:// A,tcp:// B)?randomize = true& startupMaxReconnectAttempts = 1& timeout = 2000 

现在我的URI是(注意 transport。* 前缀):

 故障转移://(tcp:// A,tcp:// B)?transport.randomize = true& transport.startupMaxReconnectAttempts = 1& transport .timeout = 2000 

,它可以正常工作,我可以处理抛出的异常并继续使用我的应用程序。



享受


I have C# application using nms.activemq 1.5.0.

When my application starts it tries to connect to the broker using failover protocol (I have two brokers in master-slave configuration).
If both brokers down my application is stuck in wait because of the connection.start().
I tried every bit of info i found on the web - I tried every attribute of the failover protocol, also tried setting the connection timeout, tried transport.requesttimeout.

I also tried a newer version of nms.activemq, but nothing seems to solve the issue.

Any idea on what can cause this problem or any workaround?

解决方案

After mining google results fI found this thread

Tim Bish answered the developer there that in NMS there is a prefix transport.* that need to added to all transport properties.

my original uri was:

failover://(tcp://A,tcp://B)?randomize=true&startupMaxReconnectAttempts=1&timeout=2000

and now my URI is (pay attention on transport.* prefix):

failover://(tcp://A,tcp://B)?transport.randomize=true&transport.startupMaxReconnectAttempts=1&transport.timeout=2000

which is working and I handle the exception thrown and continue with my App.

Enjoy

这篇关于ActiveMQ NMS:当代理关闭时,connection.start()与故障转移协议一起挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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