JMS objects are shared between consumers in JBossMessaging
Issue
- The code in our application has a clustered JMS queue where the only type of message being sent is a StreamMessage with a single long value in its payload, created roughly as follows:
StreamMessage msg = queueSession.createStreamMessage();
msg.writeLong(somevalue);
queueSender.send(msg);
-
The MDB that receives on the queue does this in its onMessage(Message msg) method:
long myvalue = ((StreamMessage)msg).readLong();
It works most of the time. But once in awhile (about 5%) a MessageEOFException is thrown out of readLong:
javax.jms.MessageEOFException:
at org.jboss.jms.message.JBossStreamMessage.readLong(JBossStreamMessage.java:356)
at org.jboss.jms.message.StreamMessageProxy.readLong(StreamMessageProxy.java:112)
at aaa.bbb.ProcessExitProcessorBean.onMessage(ProcessExitProcessorBean.java:236)
...
Environment
- JBoss Enterprise Application Platform (EAP)
- 4.3
- 5.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
