Message properties get erased when routing message
--------------------------------------------------
Key: QPID-677
URL: https://issues.apache.org/jira/browse/QPID-677
Project: Qpid
Issue Type: Bug
Components: Java Broker
Affects Versions: M2, M2.1
Reporter: Martin Ritchie
Fix For: M2.1
In adding support for JMSXUserID I noted that the underlying data for the
message _headers is being erased.
I haven't had time to track this down but here is what I see.
I update the userID value in the header to be the authenticated user id. This
causes the encoded Message Headers to be set to null. The data for which is
copied in to a local byte[] so can be reencoded. However, the _headers
FieldTable only maintains a reference to the original ByteBuffer. When routing
the message the _headers may be inspected if a Selector is being used. Because
the broker has not decoded the fieldtable values it now attempts to do so. For
some reason the ByteBuffer data no longer exists and so a decoding is not
possible.
pool-2-thread-4 2007-11-06 17:30:20,983 DEBUG
[qpid.server.filter.PropertyExpression] Looking up property:Selector
Dispatcher-Channel-1 2007-11-06 17:30:20,999 DEBUG
[apache.qpid.client.BasicMessageConsumer] Message is of type:
org.apache.qpid.client.message.JMSTextMessage
pool-2-thread-4 2007-11-06 17:30:20,999 ERROR
[qpid.server.protocol.AMQPFastProtocolHandler] Exception caught
inAMQProtocolSession(anonymous(26156009)), closing session explictly:
java.nio.BufferUnderflowException
java.nio.BufferUnderflowException
at java.nio.Buffer.nextGetIndex(Buffer.java:474)
at java.nio.DirectByteBuffer.get(DirectByteBuffer.java:205)
at
org.apache.mina.common.support.BaseByteBuffer.get(BaseByteBuffer.java:203)
at org.apache.mina.common.ByteBuffer.getUnsigned(ByteBuffer.java:487)
at
org.apache.qpid.framing.AMQShortString.readFromBuffer(AMQShortString.java:172)
at
org.apache.qpid.framing.EncodingUtils.readAMQShortString(EncodingUtils.java:660)
at org.apache.qpid.framing.FieldTable.setFromBuffer(FieldTable.java:962)
at
org.apache.qpid.framing.FieldTable.populateFromBuffer(FieldTable.java:111)
at
org.apache.qpid.framing.FieldTable.initMapIfNecessary(FieldTable.java:171)
at org.apache.qpid.framing.FieldTable.keySet(FieldTable.java:890)
at
org.apache.qpid.server.filter.PropertyExpression.evaluate(PropertyExpression.java:279)
at
org.apache.qpid.server.filter.ComparisonExpression$1.evaluate(ComparisonExpression.java:245)
at
org.apache.qpid.server.filter.ComparisonExpression.matches(ComparisonExpression.java:590)
at
org.apache.qpid.server.filter.JMSSelectorFilter.matches(JMSSelectorFilter.java:52)
at
org.apache.qpid.server.filter.SimpleFilterManager.allAllow(SimpleFilterManager.java:57)
at
org.apache.qpid.server.queue.SubscriptionImpl.checkFilters(SubscriptionImpl.java:442)
at
org.apache.qpid.server.queue.SubscriptionImpl.hasInterest(SubscriptionImpl.java:423)
at
org.apache.qpid.server.queue.SubscriptionSet.nextSubscriberImpl(SubscriptionSet.java:154)
at
org.apache.qpid.server.queue.SubscriptionSet.nextSubscriber(SubscriptionSet.java:129)
at
org.apache.qpid.server.queue.ConcurrentSelectorDeliveryManager.deliver(ConcurrentSelectorDeliveryManager.java:818)
at org.apache.qpid.server.queue.AMQQueue.process(AMQQueue.java:803)
at
org.apache.qpid.server.txn.NonTransactionalContext.deliver(NonTransactionalContext.java:99)
at org.apache.qpid.server.queue.AMQMessage.deliver(AMQMessage.java:735)
at
org.apache.qpid.server.queue.AMQMessage.addContentBodyFrame(AMQMessage.java:377)
at
org.apache.qpid.server.AMQChannel.publishContentBody(AMQChannel.java:266)
at
org.apache.qpid.server.protocol.AMQMinaProtocolSession.contentBodyReceived(AMQMinaProtocolSession.java:389)
at
org.apache.qpid.server.protocol.AMQMinaProtocolSession.frameReceived(AMQMinaProtocolSession.java:220)
at
org.apache.qpid.server.protocol.AMQMinaProtocolSession.dataBlockReceived(AMQMinaProtocolSession.java:191)
at
org.apache.qpid.server.protocol.AMQPFastProtocolHandler.messageReceived(AMQPFastProtocolHandler.java:206)
at
org.apache.mina.common.support.AbstractIoFilterChain$2.messageReceived(AbstractIoFilterChain.java:189)
at
org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:502)
at
org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:52)
at
org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:777)
at
org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(SimpleProtocolDecoderOutput.java:60)
at
org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:185)
at
org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:502)
at
org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:52)
at
org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:777)
at
org.apache.qpid.pool.PoolingFilter.messageReceived(PoolingFilter.java:317)
at
org.apache.mina.filter.ReferenceCountingIoFilter.messageReceived(ReferenceCountingIoFilter.java:96)
at
org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:502)
at
org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:52)
at
org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:777)
at org.apache.qpid.pool.Event$ReceivedEvent.process(Event.java:86)
at org.apache.qpid.pool.Job.processAll(Job.java:109)
at org.apache.qpid.pool.Job.run(Job.java:147)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
I don't quite see what is going wrong. However, if the FieldTable is populated
from the buffer before routing then the data can be re-encoded. Simplist way to
do that is to request the getHeaders().keySet()
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.