MapMessage received it always empty

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

MapMessage received it always empty

Steve
Hello,

In my application, I am sending a MapMessage to a Queue via an embedded ActiveMQ broker from one thread, and receiving it in another thread in the same application (in a class that implements the MessageListener interface).  Log statements in my application indicate that the contents of the map are populated when I send it, but empty when it is received.  I am not sure what I am doing wrong here.

Note that I am able to send and receive TextMessages just fine within my application, it is only MapMessages that are having this problem.  I am using ActiveMQ version 5.14.1.

The following is the log output from when the MapMessage is sent, and then received:

Jan 13, 2017 10:05:07 AM com.bmc.bcan.engine.network.cluster.Helper
INFO: [Thread=Thread-28] sending ClusterScheduling message: ActiveMQMapMessage {commandId = 0, responseRequired = false, messageId = null, originalDestination = null, originalTransactionId = null, producerId = null, destination = null, transactionId = null, expiration = 0, timestamp = 0, arrival = 0, brokerInTime = 0, brokerOutTime = 0, correlationId = null, replyTo = null, persistent = false, type = null, priority = 0, groupID = null, groupSequence = 0, targetConsumerId = null, compressed = false, userID = null, content = null, marshalledProperties = null, dataStructure = null, redeliveryCounter = 0, size = 0, properties = null, readOnlyProperties = false, readOnlyBody = false, droppable = false, jmsXGroupFirstForConsumer = false} ActiveMQMapMessage{ theTable = {Command=ScheduleSimpleTask, Keystring=961346758-1, Time=1484323507060, Data=null, DbSessionName=sysadmin} }

Jan 13, 2017 10:05:07 AM com.bmc.bcan.engine.service.scheduler.ClusterSchedulingQueue
INFO: [Thread=ActiveMQ Session Task-4] received ClusterScheduling message: ActiveMQMapMessage {commandId = 19, responseRequired = true, messageId = ID:clm-aus-000599.bmc.com-44320-1484323346997-4:1:3:1:3, originalDestination = null, originalTransactionId = null, producerId = ID:clm-aus-000599.bmc.com-44320-1484323346997-4:1:3:1, destination = queue://ClusterScheduling, transactionId = null, expiration = 0, timestamp = 1484323507063, arrival = 0, brokerInTime = 1484323507064, brokerOutTime = 1484323507074, correlationId = null, replyTo = null, persistent = true, type = null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId = null, compressed = false, userID = null, content = org.apache.activemq.util.ByteSequence@5a78b3c7, marshalledProperties = null, dataStructure = null, redeliveryCounter = 0, size = 1024, properties = null, readOnlyProperties = true, readOnlyBody = true, droppable = false, jmsXGroupFirstForConsumer = false} ActiveMQMapMessage{ theTable = {} }


Thanks in advance for any suggestions,
Steve
Reply | Threaded
Open this post in threaded view
|

Re: MapMessage received it always empty

Steve
I think I just answered my own question with some more google searching.  I found the following discussion on this:

http://stackoverflow.com/questions/19538374/activemq-mapmessage-receive-message-with-empty-thetable

Seems that until you actually parse into the MapMessage contents explicitly, attempts to stringify it will show the contents to be empty, by design.