activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Bish <tabish...@gmail.com>
Subject Re: ActiveMQ message content is truncated
Date Tue, 06 Oct 2009 19:26:38 GMT
On Tue, 2009-10-06 at 12:19 -0700, zeptov wrote:
> I copied the wrong code for the sender. Here's an update with some more
> debugging.
> 
> The length of the message content before sending is 10366. When received,
> all properties are okay; the message content key is present, but the content
> is an empty string.
> 

Could you open a new Jira issue for this problem and attach your short,
but complete sender receiver test app.  This looks to be a bug, opening
an issue will make sure it doesn't get lost.

Regards
Tim.

> Sender:
> 
> 
>     try
>     {
>         session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
>         MessageProducer producer = null;
>         Topic topic = session.createTopic(getSubject());
>         producer = session.createProducer(topic);
>         producer.setDeliveryMode(DeliveryMode.PERSISTENT);
>         MapMessage mapMessage = session.createMapMessage();
>         if(properties!=null && !properties.isEmpty())
>         {
>             java.util.Iterator keyIter = properties.keySet().iterator();
>             while(keyIter.hasNext())
>             {
>                 String key = keyIter.next();
>                 mapMessage.setStringProperty(key, properties.get(key));
>             }
>         }
>         mapMessage.setString("MessageContent", xmlCommand);
>         logger.info("Message content length=" +
> mapMessage.getString("MessageContent").length());
>         producer.send(mapMessage);
>     } 
> 
> 
> Receiver:
> 
> 
>     private void receiver_Listener(IMessage message)
>     {
>         IMapMessage mapMessage = message as IMapMessage;
>         if (mapMessage != null)
>         {
>             string content = mapMessage.Body.GetString("MessageContent");
>             Logger.Info("Body count=" + mapMessage.Body.Count);
>             Logger.Info("Prop count=" + mapMessage.Properties.Count);
>             foreach (string curkey in mapMessage.Body.Keys)
>             {
>                 Logger.Info("Body Key=" + curkey + ", value=" +
> mapMessage.Body[curkey]);
>             }
>             foreach (string curkey in mapMessage.Properties.Keys)
>             {
>                 Logger.Info("Prop Key=" + curkey + ", value=" +
> mapMessage.Properties[curkey]);
>             }
>         }
>     }
> 
> 


Mime
View raw message