使用“故障转移:"是否有任何好处?带有"vm:"协议在ActiveMQ中传输? [英] Are there any benefits in using the "failover:" protocol with the "vm:" transport in ActiveMQ?

查看:148
本文介绍了使用“故障转移:"是否有任何好处?带有"vm:"协议在ActiveMQ中传输?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据此答案,即使将故障转移"协议与"tcp"传输一起使用,也会带来很多好处有一个地址.

According to this answer, there are benefits from using the "failover" protocol with a "tcp" transport, even with a single address.

除此之外, ActiveMQ文档,则适用以下条件(强调我的意思):

In addition to this, the ActiveMQ documentation, the following applies (emphasis mine):

如果JMS代理发生故障,ActiveMQ可以使用故障转移:协议自动重新连接到可用的JMS代理.这不仅会自动重新连接,还会恢复任何临时目的地,会话,生产者,最重要的是消费者.

在使用"vm"传输时这是否也适用?

Does this also apply when using the "vm" transport?

我们看到队列使用者在队列填满时停止接听消息的频繁问题,而我们还没有找到解决方法.这是与ActiveMQ v5.6.0一起提供的-目前我们正在升级到v5.14.5,但也想探索其他选项.

We are seeing frequent issues with queue consumers stopping to pick up messages, while the queue fills up, and we have not found a fix for this yet. This is with ActiveMQ v5.6.0 - we're upgrading to v5.14.5 at the moment, but want to explore additional options, too.

我们当前对ActiveMQConnectionFactory的Spring配置如下:

Our current Spring configuration for the ActiveMQConnectionFactory looks like this:

<bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory"
    depends-on="amqEmbeddedBroker">
    <property name="brokerURL" value="vm://localhost" />
    <property name="watchTopicAdvisories" value="false" />
</bean>

在这种情况下,将URL从vm://localhost更改为failover:(vm://localhost)会带来什么好处,即,安全防范连接因任何原因而关闭的情况?将URL更改为包含failover:部分时,我可以看到创建了FailoverTransport的实例,但是在vm传输的情况下,它提供了什么好处吗?

Would changing the URL from vm://localhost to failover:(vm://localhost) provide any benefit in this case, i.e. safe-guarding against connections being closed for whatever reason? When changing the URL to include the failover: part, I can see that an instance of FailoverTransport is created, but does it provide any benefit in the case of the vm transport?

推荐答案

如果连接失败,故障转移将尝试重新建立连接.因此,如果您执行的操作通常会导致连接失败崩溃,则不会看到异常,但它将以静默方式尝试重新连接.因此,如果您的内存代理崩溃了,客户端将保持沉默,并可能发出一些尝试重新连接的日志.

Failover will try to get a reconnection if the connection fails. So if you're doing an operation that would normally crash of connection failure, you won't see an exception but it will silently try to reconnect. So if your in memory broker goes dead, the client will be silent and perhaps issue some log that it tries to reconnect.

VM连接不会因为网络问题而失败,因此您可能需要进一步调查.但是升级似乎是第一步.

VM connections do not fail because of network issues, so you may want to investigate further. But upgrading seems like the first step.

这篇关于使用“故障转移:"是否有任何好处?带有"vm:"协议在ActiveMQ中传输?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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