activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hiram Chirino" <hi...@hiramchirino.com>
Subject Re: Disappearing Message Properties
Date Mon, 04 Dec 2006 13:54:27 GMT
Wild.  Do you get an exception when you try to get the property?  And
btw.. notice that while properties may be null, marshalledProperties
is not null.  The properties are just in marshaled form when you try
to access them.

On 11/29/06, TiredAndEmotional <stevesiller@yahoo.co.uk> wrote:
>
> Hi,
>
> I am running ActiveMQ4.1. I'm not sure what I should expect from user
> defined message properties, but the behaviour I am seeing is perplexing.
>
> The basic problem is as follows. I set a user defined int property in a
> message (say, CID) and ActiveMQ logs this when the message is sent, thus.
>
> 156 [main] DEBUG pache.activemq.ActiveMQSession  - Sending message:
> ActiveMQTextMessage {commandId = 0, responseRequired = false, messageId =
> ID:Media-Centre-4005-1164839267578-1:0:1:1:2, originalDestination = null,
> originalTransactionId = null, producerId =
> ID:Media-Centre-4005-1164839267578-1:0:1:1, destination = queue://QQ,
> transactionId = null, expiration = 0, timestamp = 1164839268046, arrival =
> 0, correlationId = null, replyTo = null, persistent = false, type = null,
> priority = 4, groupID = null, groupSequence = 0, targetConsumerId = null,
> compressed = false, userID = null, content = null, marshalledProperties =
> null, dataStructure = null, redeliveryCounter = 0, size = 0, properties =
> {CID=2}, readOnlyProperties = true, readOnlyBody = true, droppable = false,
> text = Message 2}
>
> Note that in this log entry, there is a property called CID=2.
>
> If I run a message producer that alternates between messages with CID=1 and
> CID=2, and then run a consumer with a selector "CID=2", it will only receive
> half the messages sent as expected. However, if the consumer tries:
>
> message.getIntProperty("CID");
>
> an Exception is thrown. Indeed, ActiveMQ logging shows that the received
> message has no properties:
>
> 203 [main] DEBUG tivemq.ActiveMQMessageConsumer  - Received message:
> MessageDispatch {commandId = 0, responseRequired = false, consumerId =
> ID:Media-Centre-4009-1164839612437-1:0:1:1, destination = queue://QQ,
> message = ActiveMQTextMessage {commandId = 6, responseRequired = false,
> messageId = ID:Media-Centre-4005-1164839267578-1:0:1:1:2,
> originalDestination = null, originalTransactionId = null, producerId =
> ID:Media-Centre-4005-1164839267578-1:0:1:1, destination = queue://QQ,
> transactionId = null, expiration = 0, timestamp = 1164839268046, arrival =
> 0, 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@2cb49d, marshalledProperties =
> org.apache.activemq.util.ByteSequence@105d88a, dataStructure = null,
> redeliveryCounter = 0, size = 0, properties = null, readOnlyProperties =
> true, readOnlyBody = true, droppable = false, text = null},
> redeliveryCounter = 0}
>
> Note that "properties=null" in the above logging and the text of the message
> also now seems to be null, instead of "Message 2" though:
>
> String text = textMessage.getText();
>
> returns the appropriate message "Message 2"
>
> What am I not understanding? Why can't I retrieve the property that the
> consumer's selector could see?
>
> Many thanks for your time and consideration in advance,
>
> Steve Siller
> --
> View this message in context: http://www.nabble.com/Disappearing-Message-Properties-tf2728313.html#a7609654
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


-- 
Regards,
Hiram

Blog: http://hiramchirino.com

Mime
View raw message