We have an ActiveMQ topic into which a Java program inserts messages, where a
C# client retrieves them. This has been working fine for a long time, with
most of our messages around 1 - 2K. Recently we had a message closer to 10K
(9,910 bytes); we take the message, wrap it with some XML, and send it to
the topic.


When the C# application pulls the messages, it has been working fine. For
this one message, it retrieves a message with no content. The code below is
snipped, but the other message headers are fine, and it parses fine as an
IMapMessage. It's only the content that was truncated (to length 0 - it's
empty).


I can see nothing in the configuration files or elsewhere that would enforce
a limit; the <systemUsage> parameter is commented out in the config
files. The code works fine for the other messages.


The code to enqueue is:



session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
Queue queue = session.createQueue(getSubject());
MessageProducer producer = session.createProducer(queue);
producer.setDeliveryMode(DeliveryMode.PERSISTENT);
Message message = session.createObjectMessage(body);
producer.send(message);


To dequeue:


{
    IConnectionFactory factory = new ConnectionFactory(_msgBusURL);
    IConnection conn = factory.CreateConnection();
    conn.ExceptionListener += new ExceptionListener(conn_ExceptionListener);
    ISession session =
conn.CreateSession(AcknowledgementMode.AutoAcknowledge);
    IDestination dest = session.GetTopic(TOPICTYPE);
    IMessageConsumer receiver = session.CreateConsumer(dest);
    receiver.Listener += new MessageListener(receiver_Listener);
    conn.Start();
}

private void receiver_Listener(IMessage message)
{
    IMapMessage mapMessage = message as IMapMessage;
    if (mapMessage != null)
    {
        string content = mapMessage.Body.GetString("MessageContent");
        debug("Content retrieved is: " + content);
    }
}


-- 
View this message in context: 
http://www.nabble.com/ActiveMQ-message-content-is-truncated-tp25769997p25769997.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to