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 =
(List<EttexObject>)listOfEttexObj; 
        for (int q = 0; q < listOfEttexObjects.size(); q++) { 
            EttexObject eo = listOfEttexObjects.get(q); 
            template.sendBody("jms:" + eo.getAccountName() +
"_2",x.toXML(eo)); 
            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. 

regards 

p.s. Can synchronous/asynchronous ActiveMQ mode have anything to do with my
problem? 
-- 
View this message in context: 
http://old.nabble.com/ActiveMQ-mixes-up-order-of-messages-while-receiving-them-from-Camel-tp29008581p29008581.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to