ActiveMQ 请求-回复超时
我有这个 activeMQ 问题,我向远程代理发送请求(从 Camel 应用程序)。请参阅下面的配置:
<bean id="providerJMSConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="alwaysSessionAsync" value="false"/>
<property name="alwaysSyncSend" value="true"/>
<property name="brokerURL"><value>${remote-broker-url}</value></property>
<property name="clientID" value=""/>
<property name="closeTimeout" value="150000"/>
<property name="copyMessageOnSend" value="true"/>
<property name="disableTimeStampsByDefault" value="false"/>
<property name="dispatchAsync" value="false"/>
<property name="objectMessageSerializationDefered" value="false"/>
<property name="optimizeAcknowledge" value="true"/>
<property name="optimizedMessageDispatch" value="true"/>
<property name="password" value=""/>
<property name="producerWindowSize" value="0"/>
<property name="statsEnabled" value="false"/>
<property name="useAsyncSend" value="false"/>
<property name="useCompression" value="false"/>
<property name="useRetroactiveConsumer" value="false"/>
<property name="userName" value=""/>
<property name="watchTopicAdvisories" value="true"/>
<property name="sendTimeout" value="0"/>
</bean>
<bean id="aeroProviderJMSConfig" class="org.apache.camel.component.jms.JmsConfiguration">
<property name="connectionFactory" ref="providerJMSConnectionFactory"/>
<property name="deliveryPersistent" value="true"/>
<property name="explicitQosEnabled" value="true"/>
<property name="priority" value="${jms-message-priority}"/>
<property name="acceptMessagesWhileStopping" value="false"/>
</bean>
<bean id="providerJMS" class="org.apache.camel.component.jms.JmsComponent">
<property name="configuration" ref="providerJMSConfig"/>
</bean>
<osgi:camelContext xmlns="http://camel.apache.org/schema/spring" trace="true">
<endpoint id="providerEndpoint" uri="providerJMS:queue:provider?replyTo=providerResponse&requestTimeout=120000"/>
<route>
<from .....>
<to ref="providerEndpoint"/>
....
</route>
每当我检查远程代理上的“providerResponse”队列时,我意识到响应消息永远不会被拾取。即使我要求响应消息在那里排队(实际上已经完成),它仍然保留在消息中。
我的问题是,为什么骆驼会拒绝从这个队列中获取这条消息? 请注意,交换模式已明确设置为 InOut。
我注意到它说 CorrelationID 不一样,即使我检查请求的 JMSCorrelationID 和响应对我来说看起来是一样的。
是否有可用于匹配 JMS 请求/回复响应的备用选择器?
I have this activeMQ issue where I send a request to a remote broker (from a Camel Application). See config below:
<bean id="providerJMSConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="alwaysSessionAsync" value="false"/>
<property name="alwaysSyncSend" value="true"/>
<property name="brokerURL"><value>${remote-broker-url}</value></property>
<property name="clientID" value=""/>
<property name="closeTimeout" value="150000"/>
<property name="copyMessageOnSend" value="true"/>
<property name="disableTimeStampsByDefault" value="false"/>
<property name="dispatchAsync" value="false"/>
<property name="objectMessageSerializationDefered" value="false"/>
<property name="optimizeAcknowledge" value="true"/>
<property name="optimizedMessageDispatch" value="true"/>
<property name="password" value=""/>
<property name="producerWindowSize" value="0"/>
<property name="statsEnabled" value="false"/>
<property name="useAsyncSend" value="false"/>
<property name="useCompression" value="false"/>
<property name="useRetroactiveConsumer" value="false"/>
<property name="userName" value=""/>
<property name="watchTopicAdvisories" value="true"/>
<property name="sendTimeout" value="0"/>
</bean>
<bean id="aeroProviderJMSConfig" class="org.apache.camel.component.jms.JmsConfiguration">
<property name="connectionFactory" ref="providerJMSConnectionFactory"/>
<property name="deliveryPersistent" value="true"/>
<property name="explicitQosEnabled" value="true"/>
<property name="priority" value="${jms-message-priority}"/>
<property name="acceptMessagesWhileStopping" value="false"/>
</bean>
<bean id="providerJMS" class="org.apache.camel.component.jms.JmsComponent">
<property name="configuration" ref="providerJMSConfig"/>
</bean>
<osgi:camelContext xmlns="http://camel.apache.org/schema/spring" trace="true">
<endpoint id="providerEndpoint" uri="providerJMS:queue:provider?replyTo=providerResponse&requestTimeout=120000"/>
<route>
<from .....>
<to ref="providerEndpoint"/>
....
</route>
Whenever I check the "providerResponse" queue on the remote broker, I realise the resposne message is never picked up. it remains in the message even I had asked response messages be queued in there (which was actually done).
My question is, why will the Camel refuse to get this message from this queue?
Note that Exchange pattern was explicitly set to InOut.
I noticed it said the CorrelationID were not the same even though I check the JMSCorrelationID for the request and the response which look the same to me.
Is there an alternate Selector I can use for matching JMS Request/Reply response?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试使用
,而不是使用
。如果省略 URI 上的replyTo 参数,Camel 将创建一个临时队列,仅用于该响应。Rather than using
<to ref="providerEndpoint"/>
try<inOut ref="providerEndpoint"/>
. If you omit the replyTo parameter on the URI, Camel wil create a temporary queue to be used for that response only.