activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sonicBasher <>
Subject ActiveMQ mixes up order of messages while receiving them from Camel
Date Mon, 28 Jun 2010 15:15:18 GMT

At the end of my camel route I have a following class which I use to put
messages in ActiveMQ: 

public class MessageProducer { 

    private ProducerTemplate template = null; 

    public MessageProducer(ProducerTemplate template) { 
        this.template = template; 

    public void produce(@Body List listOfEttexObj) { 
        System.out.println("Entered produce() method"); 
        XStream x = new XStream(); 
        List<EttexObject> listOfEttexObjects =
        for (int q = 0; q < listOfEttexObjects.size(); q++) { 
            EttexObject eo = listOfEttexObjects.get(q); 
            template.sendBody("jms:" + eo.getAccountName() +
            System.out.println("Sent type: " + eo.getMessage().getType()); 

*XStream is just a library for converting objects to XML, has nothing to do
with anything
**EttexObject is my POJO class 

Now, I noticed that whenever I send objects (from the list passed as an
argument) to the queues, which I implicitly create using ProducerTemplate,
most of the time the order of delivered messages is correct, but there's
always one queue, which gets the mixed up messages. I can't really figure
out why. I tried to use the requestBody method, instead of sendBody, to no
avail. I also double checked the lists that come in - the order of objects
inside them is fine. Honestly I'm kind of stuck here. Will be grateful for
any tips. 


p.s. Can synchronous/asynchronous ActiveMQ mode have anything to do with my
View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message