Jms 在使用非openwire协议时使用Camel ActiveMQComponent

Jms 在使用非openwire协议时使用Camel ActiveMQComponent,jms,activemq,apache-camel,stomp,Jms,Activemq,Apache Camel,Stomp,按照activemq.apache.org上的指导原则,使用openwire作为传输协议可以非常容易地启动和运行 让URI具有跟踪选项,可以查看握手和所有:@testing.activeMqInstance=failover:tcp://localhost:61616?trace=true 09:36:06.764 [ActiveMQ Task-1] DEBUG o.a.a.t.failover.FailoverTransport - Attempting 0th connect to: t

按照activemq.apache.org上的指导原则,使用openwire作为传输协议可以非常容易地启动和运行

让URI具有
跟踪
选项,可以查看握手和所有:
@testing.activeMqInstance=failover:tcp://localhost:61616?trace=true

09:36:06.764 [ActiveMQ Task-1] DEBUG o.a.a.t.failover.FailoverTransport - Attempting  0th  connect to: tcp://localhost:61616?trace=true
09:36:06.780 [ActiveMQ Task-1] DEBUG o.a.a.transport.WireFormatNegotiator - Sending: WireFormatInfo { version=9, properties={MaxFrameSize=9223372036854775807, CacheSize=1024, CacheEnabled=true, SizePrefixDisabled=false, MaxInactivityDurationInitalDelay=10000, TcpNoDelayEnabled=true, MaxInactivityDuration=30000, TightEncodingEnabled=true, StackTraceEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
09:36:06.780 [ActiveMQ Task-1] DEBUG o.a.a.t.TransportLogger.Connection:2 - SENDING: WireFormatInfo { version=9, properties={MaxFrameSize=9223372036854775807, CacheSize=1024, CacheEnabled=true, SizePrefixDisabled=false, MaxInactivityDurationInitalDelay=10000, TcpNoDelayEnabled=true, MaxInactivityDuration=30000, TightEncodingEnabled=true, StackTraceEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
09:36:06.780 [ActiveMQ Task-1] DEBUG o.a.a.t.failover.FailoverTransport - Connection established
09:36:06.780 [ActiveMQ Task-1] INFO  o.a.a.t.failover.FailoverTransport - Successfully connected to tcp://localhost:61616?trace=true
09:36:06.780 [ActiveMQ Transport: tcp://localhost/127.0.0.1:61616@4060] DEBUG o.a.a.t.TransportLogger.Connection:2 - RECEIVED: WireFormatInfo { version=9, properties={CacheSize=1024, MaxFrameSize=9223372036854775807, CacheEnabled=true, SizePrefixDisabled=false, TcpNoDelayEnabled=true, MaxInactivityDurationInitalDelay=10000, MaxInactivityDuration=30000, TightEncodingEnabled=true, StackTraceEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
但是,在进行跺脚(或任何与此相关的amqp)时

将URI更改为
@testing.activeMqInstance=failover:stomp://localhost:61612?trace=true
似乎只是建立了连接(套接字),而没有启动协议:

09:37:07.444 [ActiveMQ Task-1] DEBUG o.a.a.t.failover.FailoverTransport - urlList connectionList:[stomp://localhost:61612?trace=true], from: [stomp://localhost:61612?trace=true]
09:37:07.444 [ActiveMQ Task-1] DEBUG o.a.a.t.failover.FailoverTransport - Attempting  0th  connect to: stomp://localhost:61612?trace=true
09:37:07.444 [ActiveMQ Task-1] DEBUG o.a.a.t.failover.FailoverTransport - Connection established
09:37:07.444 [ActiveMQ Task-1] INFO  o.a.a.t.failover.FailoverTransport - Successfully connected to stomp://localhost:61612?trace=true
[silence]
有人知道为什么交通工具上没有活动吗? 在代理中启用了相同的
trace
选项,但没有出现
trace
日志记录告诉我客户端(ActiveMQComponent)没有发送第一个
CONNECT

作为参考,该组件是使用Spring xml配置的:

<bean id="jmsActiveMqConnectionFactory" 
    class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL" value="${activeMqInstance}" />
    <property name="userName" value="${activeMqUsername}"/>
    <property name="password" value="${activeMqPassword}"/>
</bean> 
<bean id="pooledActiveMqConnectionFactory" 
    class="org.apache.activemq.pool.PooledConnectionFactory" init-method="start" destroy-method="stop">
    property name="maxConnections" value="8" />
    <property name="connectionFactory" ref="jmsActiveMqConnectionFactory" />
</bean>
<bean id="jmsActiveMqConfig" 
    class="org.apache.camel.component.jms.JmsConfiguration">
    <property name="connectionFactory" ref="pooledActiveMqConnectionFactory"/>
    <property name="concurrentConsumers" value="1"/>
</bean>
<bean id="activemq" 
    class="org.apache.activemq.camel.component.ActiveMQComponent">
    <property name="configuration" ref="jmsActiveMqConfig"/>

property name=“maxConnections”value=“8”/>


欢迎您的任何意见!:-)

ActiveMQ JMS客户端仅支持Openwire协议

如果您想使用STOMP,我建议您使用


如果要使用AMQP,请使用Hi Hiram上的AMQP 1.0 JMS客户端!我曾尝试使用stompjms客户机(1.13),但它似乎无法作为持久订户正确连接。1.12版本确实如此,但在接收来自代理的消息时(从标头或类似文件中检索“JMSDestinationID”)出现了一些NPE供参考:客户端在发送之前成功地访问了此代码:if(persistent){headerMap.put(persistent,TRUE);};尝试了amqp选项,结果是:-/jhberges,请尝试使用新的stompjms快照。它已被更新,以支持ActiveMQ上的持久SUB。它甚至有一个测试用例来验证它的工作。见: