Reputation: 414
I am learning to use Apache Camel to solve a messaging problem. The following points explains the gist of the problem.
I am finding it difficult to follow the book examples and fit it to my problem. Please let me know how this can be solved using Apache Camel.
Thanks!
Upvotes: 1
Views: 1773
Reputation: 21015
just need to setup your activemq
component like this
<bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent"> <property name="brokerURL" value="tcp://mybroker:61616"/> </bean>
then define routes to produce/consume from ActiveMQ queues, convert to/from JSON as needed...
for example...one route to take the client request, convert to JSON and send to a queue
from("direct:clientRequest") .marshal().json() .to("activemq:firstQueue");
then another route to pickup from another queue and unmarshal from JSON and do something with it...
from("activemq:otherQueue") .unmarshal().json() .to("<do something>");
Upvotes: 4