javax.jms.JMSException: Wire format negociation timeout: peer did not send his w
在应用activemq过程中,进行压力测试一段时间后出现,javax.jms.JMSException:Wireformatnegociationtimeout:peerdidnotsendhiswireformat.
javax.jms.JMSException:Wireformatnegociationtimeout:peerdidnotsendhiswireformat.
atorg.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:58)
atorg.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1185)
atorg.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1263)
atorg.apache.activemq.ActiveMQConnection.start(ActiveMQConnection.java:449)
错误。
我的spring相关配置文件为
<beanid="connectionFactory"class="org.apache.activemq.pool.PooledConnectionFactory"destroy-method="stop">
<propertyname="connectionFactory">
<beanclass="org.apache.activemq.ActiveMQConnectionFactory">
<propertyname="brokerURL"value="failover://(tcp://127.0.0.1:61676)?initialReconnectDelay=30000&maxReconnectAttempts=15"/>
<propertyname="userName"value=""/>
<propertyname="password"value=""/>
</bean>
</property>
</bean>
=========================
官方提faq已对这个问题进行描述
出现这个问题有三种
1.确定能连通到mq
You'reconnectingtotheportnotusedbyActiveMQTCPtransport
Makesuretocheckthatyou'reconnectingtotheappropriatehost:port
2.说的是关于日志的
这个我没细看
3.在网络不稳定的情况需要加上wireFormat.maxInactivityDurationInitalDelay
我把spring配置文件更改为
<beanid="connectionFactory"class="org.apache.activemq.pool.PooledConnectionFactory"destroy-method="stop">
<propertyname="connectionFactory">
<beanclass="org.apache.activemq.ActiveMQConnectionFactory">
<propertyname="brokerURL"value="tcp://127.0.0.1:61676?wireFormat.maxInactivityDurationInitalDelay=30000"/>
<propertyname="userName"value=""/>
<propertyname="password"value=""/>
</bean>
</property>
</bean>
在测试ok