Lokesh Raj Urs
Lokesh Raj Urs

Reputation: 361

How to subscribe to a topic using Camel

I would like to subscribe to activemq topic using camel. Can anyone share the route configuration or example for doing the same.

My requirement is whenever a new data is published on the topic I want to push the content to database using ibatis.

thanks Lokesh

Upvotes: 0

Views: 2432

Answers (1)

Christian Schneider
Christian Schneider

Reputation: 19606

You do the normal setup of the jms component and use the following at the start of your route:

So the key is to write jms:topic: instead of jms:. This tells camel that the name after the colon is a topic name instead of a queue name. This make camel install a listener for the topic. So for every message sent to the topic your route is called.

Upvotes: 1

Related Questions