I'm pretty much new to Apache Camel & ActiveMQ and finding it really difficult and confusing to grasp the concept of the same.Infact, I'm new to this whole concept of JMS. I really don't understand how Apache Camel is different from ActiveMQ, because as per my understanding, both serves the same purpose of routing message from one system to the other and vice-versa. Does anyone have a real-life example, and not only the bookish knowledge, which can clear out stuffs a bit?
1 Answers
JMS, ACTIVEMQ and Apache CAMEL hold relevance in the world Distributed Applications.
Apache Camel and ActiveMQ participate in the process of routing messages from one system to another, but they play different roles in this process. They tackle two different problems
- Infrastructure: How do you connect the two systems? How to transport the message to its destination?
- Routing: How do you use the design your route for the messages?
ActiveMQ handles Infrastructure part. It provides queues, topics that connect distributed systems. Once a message arrives into either a queue or topic, ActiveMQ is responsible for ensuring that the message reaches the destination/s specified for that particular queue or topic.
Camel helps you in designing what route should your message take to reach it eventual destination. You may chose to send message to go via multiple systems to reach the eventual destination system. It helps you in case you want to process the message at some systems. It helps you handle how do the same message is understandable by different systems (Data Format).
An analogy may help reinforce the point: You decide to go tour few world cities as you part of your journey from India to say Canada. You (Analogous to Message) decide to visit Dubai, Spain, Greece, USA and Canada. You are taking with you a guide who helps you book air tickets, helps you communicate in local languages (Data Formatting). The guide is knowledgeable and helps you buy local clothes, visit good local places, eat local food ( Analogous to processing on the message ). This guide is analogous to your Apache Camel.
However, your guide takes different airlines, types of aircrafts to enable you to reach different cities. These different airlines and aircrafts, their owning companies are analogous to Apache ActiveMQ. It is your transportation mechanism.
Hope this drives some ideas home.