I found this similar behaviour as well. http://mail-archives.apache.org/mod_mbox/camel-users/201404.mbox/%3cf54f1c39-dd8a-4c17-a51d-c564f3230...@winning.com.au%3E
Appears as though the topic subscription is not guaranteed to happen before the camel context finishes starting up. So if the message is published before the subscription occurs, the message gets sent to nobody as per usual topic subscription rules. The unit test in camel puts in a thread sleep to get around the problem but IMO adding a sleep to get around race conditions are a poor solution. // give a bit of time for AMQ to properly setup topic subscribers Thread.sleep(500); I’m unsure if it’s a camel or an AMQ bug but I think the topic subscription should be guaranteed before the camel context has started up. On 21 Oct 2014, at 9:16 pm, ddewaele <ddewa...@gmail.com> wrote: > We were testing ActiveMQ topics with Camel and noticed the following > behaviour: > > - Our Camel route was up and running with an activemq topic consumer. > - Messages were published on the topic whle the route is active. > - our Camel JMS consumer that was listening on that topic didn't receive all > messages. > > We were not using Durable JMS topics or ActiveMQ Virtual Topics but I did > find it strange that it would drop messages here. > > I assume these JMS Consumers are connected to the JMS broker while messages > are put on the topic and that all messages would be properly processed. Yet > we noticed a lot of drops. > > When using ActiveMQ virtual topics we don't experience this issue and the > Camel route is always able to process all messages. > > I was just wondering why this doesn't work with a plain vanilla topic and an > active Camel route. > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Camel-JMS-message-topic-handling-tp5757853.html > Sent from the Camel - Users mailing list archive at Nabble.com.