【发布时间】:2013-01-28 18:33:56
【问题描述】:
按照 activemq.apache.org 上的指南,使用 openwire 作为传输协议很容易启动和运行。
让 URI 具有 trace 选项,让您看到握手和所有内容:@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]}
但是,在执行 stomp(或任何 amqp )时。
将URI改为@testing.activeMqInstance=failover:stomp://localhost:61612?trace=true似乎只是建立了连接(socket),并没有启动协议:
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"/>
感谢任何输入! :-)
【问题讨论】:
标签: jms activemq apache-camel stomp