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 =
[EMAIL PROTECTED], marshalledProperties =
[EMAIL PROTECTED], 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.