I've got some more clues, maybe they will help. I actually have two consumers that listen to the same topic, but slightly different selectors. They share a connection, but they have their own sessions. I traced an example of corrupt message, this is what happened.
The message was supposed to go to both consumers, and it did. As I can see from the log, on the receiver side they are represented as two different Java objects, because their addresses are different, so there should be no issue of concurrent access. Also, even from the sender point of view, they were sent separately, because I see the "brokerOutTime" is 1ms different. However, they arrived to the onMessage() call in reverse order(about 90ms apart) , which is not unusual, because the two consumers are served by different session threads. The first message (I mean the one that arrived first) looks good, but the second has this "properties = null" thing. I am thinking of optimizing my program so that it does not use two consumers, which will also reduce the traffic. But this is a different story, and I would like to know what is wrong with the way I have it now. Here are the relevant log fragments: -------------------------------------------------------------------------------------- [2010-07-28 13:45:29.482] DEBUG ActiveMQ Session Task com.moon.data.rtfeed.jms.JmsReceiver Message saved: ActiveMQMapMessage {commandId = 5768828, responseRequired = true, messageId = ID:mcny9.mooncapital.corp-39424-1280328991613-2:0:2:1:5736994, originalDestination = null, originalTransactionId = null, producerId = ID:mcny9.mooncapital.corp-39424-1280328991613-2:0:2:1, destination = topic://MKTDATA, transactionId = null, expiration = 0, timestamp = 1280339129097, arrival = 0, brokerInTime = 1280339129097, brokerOutTime = 1280339129098, correlationId = null, replyTo = null, persistent = true, type = null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId = null, compressed = false, userID = null, content = org.apache.activemq.util.byteseque...@407112a2, marshalledProperties = org.apache.activemq.util.byteseque...@3f7e6abb, dataStructure = null, redeliveryCounter = 0, size = 0, properties = {NAME=XLB US, S00029=true, JMS_SENT=1280339129097, MARKET_DATA=true, SERVER_TIME=1280339129097, TYPE=Equity, SOURCE_TIME=1280339129097}, readOnlyProperties = true, readOnlyBody = true, droppable = false} ActiveMQMapMessage{ theTable = {VOLUME=3310942} } [2010-07-28 13:45:29.572] DEBUG ActiveMQ Session Task com.moon.data.rtfeed.jms.JmsReceiver Message saved: ActiveMQMapMessage {commandId = 5768828, responseRequired = true, messageId = ID:mcny9.mooncapital.corp-39424-1280328991613-2:0:2:1:5736994, originalDestination = null, originalTransactionId = null, producerId = ID:mcny9.mooncapital.corp-39424-1280328991613-2:0:2:1, destination = topic://MKTDATA, transactionId = null, expiration = 0, timestamp = 1280339129097, arrival = 0, brokerInTime = 1280339129097, brokerOutTime = 1280339129097, correlationId = null, replyTo = null, persistent = true, type = null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId = null, compressed = false, userID = null, content = org.apache.activemq.util.byteseque...@752ec3da, marshalledProperties = org.apache.activemq.util.byteseque...@513c5950, dataStructure = null, redeliveryCounter = 0, size = 0, properties = null, readOnlyProperties = true, readOnlyBody = true, droppable = false} ActiveMQMapMessage{ theTable = {} } [2010-07-28 13:45:29.585] ERROR Thread-4 com.moon.data.rtfeed.client.ClientSubscription Problem reading message ActiveMQMapMessage {commandId = 5768828, responseRequired = true, messageId = ID:mcny9.mooncapital.corp-39424-1280328991613-2:0:2:1:5736994, originalDestination = null, originalTransactionId = null, producerId = ID:mcny9.mooncapital.corp-39424-1280328991613-2:0:2:1, destination = topic://MKTDATA, transactionId = null, expiration = 0, timestamp = 1280339129097, arrival = 0, brokerInTime = 1280339129097, brokerOutTime = 1280339129097, correlationId = null, replyTo = null, persistent = true, type = null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId = null, compressed = false, userID = null, content = org.apache.activemq.util.byteseque...@752ec3da, marshalledProperties = org.apache.activemq.util.byteseque...@513c5950, dataStructure = null, redeliveryCounter = 0, size = 0, properties = null, readOnlyProperties = true, readOnlyBody = true, droppable = false} ActiveMQMapMessage{ theTable = {} } javax.jms.JMSException: java.io.EOFException at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:62) at org.apache.activemq.command.ActiveMQMessage.propertyExists(ActiveMQMessage.java:274) at com.moon.data.rtfeed.client.ClientSubscription$DataTransformer.onMessage(ClientSubscription.java:478) at com.moon.data.rtfeed.jms.JmsReceiver$MessageDispatcher.run(JmsReceiver.java:66) Caused by: java.io.EOFException: null at java.io.DataInputStream.readInt(DataInputStream.java:375) at org.apache.activemq.util.MarshallingSupport.unmarshalPrimitiveMap(MarshallingSupport.java:83) at org.apache.activemq.util.MarshallingSupport.unmarshalPrimitiveMap(MarshallingSupport.java:73) at org.apache.activemq.command.Message.unmarsallProperties(Message.java:189) at org.apache.activemq.command.Message.getProperties(Message.java:162) at org.apache.activemq.command.ActiveMQMessage.propertyExists(ActiveMQMessage.java:272) ... 2 common frames omitted lilyevsky wrote: > > No, but I do process them asynchronously. The actual consumer saves the > message in the queue and ends the onMessage() call. Another thread picks > it up from the queue and does the actual processing. > > Even if there was concurrent access, why should it be a problem? The > message on the receiving side is read-only anyway. > > > > Gary Tully wrote: >> >> Is there any possible concurrent access to that message? >> >> On 28 July 2010 17:34, lilyevsky <lilyev...@mooncapital.com> wrote: >>> >>> I have seen on this forum other users complain about >>> javax.jms.JMSException: >>> java.io.EOFException happening in the receiver, but it seems that my >>> case is >>> in the different context. >>> >>> I am using ActiveMQ 5.3.2. >>> >>> Please look at my exception log below. The exception happens when I >>> attempt >>> an innocent check msg.propertyExists(<some name>). It is probably caused >>> by >>> the fact that in the message printout it says "properties = null". How >>> come >>> it is null? I own both sender and receiver, and all messages that I send >>> have some properties. So it does look like some corrupt message, unless >>> it >>> is some sort of internal ActiveMQ tracing message (but why is it >>> delivered >>> to my consumer?). >>> Also, I have a selector set on the consumer, so if a message does not >>> have >>> properties at all, it would not come. Which means it could get corrupt >>> on >>> the client side. >>> >>> Currently I am catching this and ignore, but I am not sure whether some >>> essential messages are lost this way. >>> >>> I tried to set wireFormat.maxInactivityDuration=0 on both sender and >>> receiver, it does not help. >>> >>> What is the mystery? >>> >>> ==================================================================== >>> >>> [2010-07-28 11:34:08.516] ERROR Thread-7 >>> com.moon.data.rtfeed.client.ClientSubscription >>> Problem >>> reading message ActiveMQMapMessage {commandId = 1992420, >>> responseRequired = >>> true, messageId = >>> ID:mcny9.mooncapital.corp-39424-1280328991613-2:0:2:1:1984887, >>> originalDestination = null, originalTransactionId = null, producerId = >>> ID:mcny9.mooncapital.corp-39424-1280328991613-2:0:2:1, destination = >>> topic://MKTDATA, transactionId = null, expiration = 0, timestamp = >>> 1280331248515, arrival = 0, brokerInTime = 1280331248515, brokerOutTime >>> = >>> 1280331248515, correlationId = null, replyTo = null, persistent = true, >>> type >>> = null, priority = 4, groupID = null, groupSequence = 0, >>> targetConsumerId = >>> null, compressed = false, userID = null, content = >>> org.apache.activemq.util.byteseque...@70e14f34, marshalledProperties = >>> org.apache.activemq.util.byteseque...@581718d1, dataStructure = null, >>> redeliveryCounter = 0, size = 0, properties = null, readOnlyProperties = >>> true, readOnlyBody = true, droppable = false} ActiveMQMapMessage{ >>> theTable = >>> {} } javax.jms.JMSException: java.io.EOFException >>> at >>> org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:62) >>> at >>> org.apache.activemq.command.ActiveMQMessage.propertyExists(ActiveMQMessage.java:274) >>> at >>> com.moon.data.rtfeed.client.ClientSubscription$DataTransformer.onMessage(ClientSubscription.java:478) >>> at >>> com.moon.data.rtfeed.jms.JmsReceiver$MessageDispatcher.run(JmsReceiver.java:69) >>> Caused by: java.io.EOFException: null >>> at java.io.DataInputStream.readInt(DataInputStream.java:375) >>> at >>> org.apache.activemq.util.MarshallingSupport.unmarshalPrimitiveMap(MarshallingSupport.java:83) >>> at >>> org.apache.activemq.util.MarshallingSupport.unmarshalPrimitiveMap(MarshallingSupport.java:73) >>> at >>> org.apache.activemq.command.Message.unmarsallProperties(Message.java:189) >>> at >>> org.apache.activemq.command.Message.getProperties(Message.java:162) >>> at >>> org.apache.activemq.command.ActiveMQMessage.propertyExists(ActiveMQMessage.java:272) >>> ... 2 common frames omitted >>> >>> -- >>> View this message in context: >>> http://old.nabble.com/Another-case-of-javax.jms.JMSException%3A-java.io.EOFException-tp29288496p29288496.html >>> Sent from the ActiveMQ - User mailing list archive at Nabble.com. >>> >>> >> >> >> >> -- >> http://blog.garytully.com >> >> Open Source Integration >> http://fusesource.com >> >> > > -- View this message in context: http://old.nabble.com/Another-case-of-javax.jms.JMSException%3A-java.io.EOFException-tp29288496p29289485.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.