activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Jabbour <dan...@infoex.com>
Subject ActiveMQ, Spring/JMS, and text messages
Date Tue, 14 Oct 2008 01:54:32 GMT
Hello,

I am trying to consume messages off an ActiveMQ queue (ActiveMQ 5.x)  
sent by a ruby STOMP client.  The messages are being sent, and I can  
see them on the ActiveMQ web portal.  The message text contains a  
string, which I also see in the portal.

However, when I receive the message in my Java/JMS consumer, I don't  
get the message text/string back, but instead I only see what look  
like message headers.  Headers and code are below. Anyone have any  
idea how I can get the text of the messages back?  Everything I've  
done is rather standard, so I have to imagine this is some kind of  
configuration issue. Thanks in advance.

TextMessage contents in consumer (printed by "logger.debug(" Text  
Message : "+objMessage);"):

Text Message : ActiveMQTextMessage {commandId = 4, responseRequired =  
false, messageId = ID:test.domain.net-42605-1223936784517-4:2:-1:1:2,  
originalDestination = null, originalTransactionId = null, producerId =  
ID:test.domain.net-42605-1223936784517-4:2:-1:1, destination = queue:// 
com.infoex.test, transactionId = null, expiration = 0, timestamp =  
1223944671503, arrival = 0, brokerInTime = 1223944671504,  
brokerOutTime = 1223945279514, correlationId = null, replyTo = null,  
persistent = true, type = null, priority = 0, groupID = null,  
groupSequence = 0, targetConsumerId = null, compressed = false, userID  
= null, content = org.apache.activemq.util.ByteSequence@26a4a2,  
marshalledProperties = org.apache.activemq.util.ByteSequence@2938d,  
dataStructure = null, redeliveryCounter = 0, size = 0, properties =  
null, readOnlyProperties = true, readOnlyBody = true, droppable =  
false, text = null}

Snippet of JMS/Java code:

    public void onMessage(Message message)
     {
         try
         {
         	if (message instanceof TextMessage) {
         		logger.debug(" TextMessage ");
         		TextMessage objMessage = (TextMessage)message;
         		logger.debug(" Text Message : "+objMessage);
         		String jsonValue = (String) objMessage. getText();
         		contentItems.fromStringEncoded(jsonValue);
         	}
         	else if (message instanceof ObjectMessage) {
         		logger.debug(" Object Message ");
         		ObjectMessage objMessage = (ObjectMessage)message;
         		contentItems = (DataObject)objMessage.getObject();
         	}

--
Daniel Jabbour
Executive Vice President of Systems Architecture
Office: (646) 778-3789 x707
daniel@infoex.com
InfoExchange, Inc.


Mime
View raw message