activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From XIAOZHIPING <XIAOZHIP...@360buy.com>
Subject activeMq customer listener slowly
Date Thu, 09 Jun 2011 10:00:17 GMT
Hi all, 

I use this config for my activeMq customer in order to reserve message from broker;

<!-- -->
<bean id="connectionFactory"  class="org.springframework.jms.connection.CachingConnectionFactory">
    <constructor-arg ref="amqConnectionFactory" />
     <property name="exceptionListener" ref="jmsExceptionListener" />
</bean>

<!-- See dbconn_Sqlserver.properties -->
    <amq:connectionFactory id="amqConnectionFactory"
      brokerURL="${mq.url}" userName="${mq.user}" password="${mq.password}"/>
<!-- -->
<bean id="connectionFactory"  class="org.springframework.jms.connection.CachingConnectionFactory">
    <constructor-arg ref="amqConnectionFactory" />
     <property name="exceptionListener" ref="jmsExceptionListener" />
</bean>

<!-- See dbconn_Sqlserver.properties -->
    <amq:connectionFactory id="amqConnectionFactory"
      brokerURL="${mq.url}" userName="${mq.user}" password="${mq.password}"/>

it was Works perfect, Today I use a large numbers of threads to send messages to the broker,then
the customer thrown some exceptions:
$1.onCommand(TransportConnection.java:179)
at org.apache.activemq.transport.TransportFiljavax.jms.JMSException: Unmatched acknowledge:
MessageAck {commandId = 2240258, responseRequired = false, ackType = 2, consumerId = ID:BJ-B28-IBM-248.xiaoxiao.com-44443-1306753710105-0:1:1:1,
firstMessageId = ID:BJ-B28-IBM-252.xiaoxiao.com-23258-1306740772622-0:123277:1:1:5, lastMessageId
= ID:BJ-B28-IBM-252.xiaoxiao.com-23258-1306740772622-0:123277:1:1:5, destination = queue://JD.STOCK,
transactionId = null, messageCount = 1, poisonCause = null}; Could not find Message-ID ID:BJ-B28-IBM-252.360buy.com-23258-1306740772622-0:123277:1:1:5
in dispatched-list (start of ack)
at org.apache.activemq.broker.region.PrefetchSubscription.assertAckMatchesDispatched(PrefetchSubscription.java:439)
at org.apache.activemq.broker.region.PrefetchSubscription.acknowledge(PrefetchSubscription.java:206)
at org.apache.activemq.broker.region.AbstractRegion.acknowledge(AbstractRegion.java:383)
at org.apache.activemq.broker.region.RegionBroker.acknowledge(RegionBroker.java:549)
at org.apache.activemq.broker.BrokerFilter.acknowledge(BrokerFilter.java:77)
at org.apache.activemq.broker.BrokerFilter.acknowledge(BrokerFilter.java:77)
at org.apache.activemq.broker.TransactionBroker.acknowledge(TransactionBroker.java:197)
at org.apache.activemq.broker.MutableBrokerFilter.acknowledge(MutableBrokerFilter.java:87)
at org.apache.activemq.broker.TransportConnection.processMessageAck(TransportConnection.java:465)
at org.apache.activemq.command.MessageAck.visit(MessageAck.java:229)
at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:306)
at org.apache.activemq.broker.TransportConnectionter.onCommand(TransportFilter.java:69)
at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:113)
at org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:227)
at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83)
at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:220)
at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:202)
at java.lang.Thread.run(Thread.java:619)
RestMessageListener-1 WARN  [2011-06-08 17:06:25] org.springframework.jms.listener.DefaultMessageListenerContainer::handleListenerSetupFailure
- Setup of JMS message listener invoker failed for destination 'REST.EXCEPTION' - trying to
recover. Cause: The Consumer is closed
MqMessageListener-1 ERROR [2011-06-08 17:06:25] org.springframework.jms.listener.DefaultMessageListenerContainer::rollbackOnExceptionIfNecessary
- Application exception overridden by rollback exception
org.springframework.transaction.IllegalTransactionStateException: Transaction is already completed
- do not call commit or rollback more than once per transaction
	at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:817)
	at com.jd.jitstock.platform.mq.listener.MQMessageListener.onMessage(MQMessageListener.java:118)
	at org.springframework.jms.listener.adapter.MessageListenerAdapter.onMessage(MessageListenerAdapter.java:339)
	at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:535)
	at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:495)
	at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467)
	at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)
	at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)
	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058)
	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1050)
	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:947)
	at java.lang.Thread.run(Thread.java:619)

Ten minutes later the log print
MqMessageListener-1 INFO  [2011-06-08 17:13:47] org.springframework.jms.listener.DefaultMessageListenerContainer::refreshConnectionUntilSuccessful
- Successfully refreshed JMS Connection
RestMessageListener-1 INFO  [2011-06-08 17:13:47] org.springframework.jms.listener.DefaultMessageListenerContainer::refreshConnectionUntilSuccessful
- Successfully refreshed JMS Connection
this is my URL 
mq.url=failover:(tcp://127.0.0.1:61616,tcp://168.2.33.1:61616)?initialReconnectDelay=10000&maxReconnectAttempts=6&randomize=false

when the exceptions thrown, then minutes later the customer has also Connectioned the
broker,but was very slowly ,i restart the activemq and tomcat,the customer was also slowly,
then I Deployment of my customer application on other PC,
 it was reserve message quickly, now I can't restart my pc , how I can solve this problem.

thanks.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message