activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From TiredAndEmotional <stevesil...@yahoo.co.uk>
Subject Re: Disappearing Message Properties
Date Thu, 30 Nov 2006 08:28:47 GMT


Hi James,

Many thanks for your response. I was incorrect about the exception...bug in
my test code. Your comment about the marshalled properties answers my
remaining concern about what is visible in the received message log output.

Once again, many thanks,

Steve Siller


James.Strachan wrote:
> 
> Could you give us the stack trace of the exception?
> 
> Note that custom properties are unmarshalled on demand which is why
> they are not always visible in logging statements.
> 
> 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.
>>
>>
> 
> 
> -- 
> 
> James
> -------
> http://radio.weblogs.com/0112098/
> 
> 

-- 
View this message in context: http://www.nabble.com/Disappearing-Message-Properties-tf2728313.html#a7615428
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message