java - Unable to consume message from ActiveMQ due to "received expired message" -
i getting below debug statement, , message listener not consuming messages.
22:25:17.870 [org.springframework.jms.listener.defaultmessagelistenercontainer#0-1] debug o.a.activemq.activemqmessageconsumer - id:consum-1401814509338-1:1:1:1 received expired message: messagedispatch {commandid = 0, responserequired = false, consumerid = id:consum-1401814509338-1:1:1:1, destination = topic://topic.all, message = activemqtextmessage {commandid = 23284887, responserequired = false, messageid = id:proc-1398663597609-0:1:1:1:23284883, originaldestination = null, originaltransactionid = null, producerid = id:proc-1398663597609-0:1:1:1, destination = topic://topic.all, transactionid = null, expiration = 1401814515925, timestamp = 1401814514925, arrival = 0, brokerintime = 1401814514934, brokerouttime = 1401814514934, correlationid = null, replyto = null, persistent = false, type = null, priority = 4, groupid = null, groupsequence = 0, targetconsumerid = null, compressed = false, userid = null, content = org.apache.activemq.util.bytesequence@2fec90f6, marshalledproperties = org.apache.activemq.util.bytesequence@62a08837, datastructure = null, redeliverycounter = 0, size = 0, properties = {_componentid=_epsync_readwrite, _attributename=networkaddress, _operation=update, _oid=51e8e5c3e4b0cc716bff43cc, _type=nodeserver, _eventtype=attribute, _repository=qdb, _userid=null}, readonlyproperties = true, readonlybody = true, droppable = false, jmsxgroupfirstforconsumer = false, text = { "_eventtype" : "attribute" , "_operation" :...kaddress"}]}}, redeliverycounter = 0}
please find spring config below:
<bean id="qconnectionfactory" class="org.springframework.jms.connection.cachingconnectionfactory"> <property name="targetconnectionfactory"> <bean class="org.apache.activemq.activemqconnectionfactory"> <property name="brokerurl"> <value>tcp://localhost:61616?wireformat.maxinactivityduration=0</value> </property> </bean> </property> </bean> <bean id="qmessagelistener" class="com.xyz.listener.qmanifestlistener" /> <jms:listener-container destination-type="topic" container-type="default" connection-factory="qconnectionfactory" acknowledge="auto" cache="auto"> <jms:listener destination="topic.all" ref="qmessagelistener" method="onmessage" /> </jms:listener-container>
please me figure out missing..
if producer sending messages short expiration value expiring before consumer. in lot of cases sort of error arises because clocks on sender , receiver not sync'd , message appears have expired when shouldn't have. solution might ensure machines sync'd using ntp.
there alternative should syncing clocks not possible use activemq timestampplugin update timestamp on incoming messages before sending them on.
Comments
Post a Comment