Apache的骆驼 - JMS INONLY行为时,经纪人下来 [英] Apache Camel - JMS inonly behaviour when broker down

查看:275
本文介绍了Apache的骆驼 - JMS INONLY行为时,经纪人下来的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我生产与骆驼的ActiveMQ组件的ActiveMQ的实例:

I am producing to an ActiveMQ instance with a Camel ActiveMQ component:

<camel:log message="YMA_IN" />
<camel:inOnly uri="activemqBroker:queue:queue.test" id="activemqBrokerTestQueue"/>
<camel:log message="YMA_OUT" />

在端点上唯一的JMS配置为TTL和池连接工厂。

The only jms configuration on the endpoint is TTL and a pooled connection factory.

<amq:connectionFactory id="jmsConnectionFactory" brokerURL="${config.jms.broker.url}" />

<bean id="pooledConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory" init-method="start" destroy-method="stop">
    <property name="maxConnections" value="15" />
    <property name="connectionFactory" ref="jmsConnectionFactory" />
</bean>

<bean id="jmsConfig" class="org.apache.camel.component.jms.JmsConfiguration">
    <property name="connectionFactory" ref="pooledConnectionFactory"/>
    <property name="timeToLive" value="${config.jms.time.to.live}" />
</bean>

<!-- Broker configuration -->
<bean id="activemqBroker" class="org.apache.activemq.camel.component.ActiveMQComponent">
    <property name="configuration" ref="jmsConfig"/>
</bean>  

如果券商下跌,交易所仍被困在INONLY(IN但不是OUT记录),貌似无限期,直到经纪人是回来了。也不例外,没有超时等...

If the broker is down, exchanges remain stuck on the inonly (logging IN but not OUT), seemingly indefinitely until the broker is back up. No exception, no timeout etc...

这是预期的行为,如果券商是跌?我期待一个例外?是否有一些配置我失踪?

Is this the expected behaviour if the broker is down? I was expecting an exception? Is there some configuration I am missing?

骆驼2.10.1

推荐答案

有也选择使用同步发送,则客户端将检测误差越早(而不必等到超时),并能够引发异常骆驼可以检测到。看到一些细节处

There is also options to use synchronous sends, then the client will detect the error sooner (and not have to wait for a timeout) and be able to throw an exception that Camel can detect. See some details at

  • http://activemq.apache.org/connection-configuration-uri.html
  • http://activemq.apache.org/async-sends.html

这篇关于Apache的骆驼 - JMS INONLY行为时,经纪人下来的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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