17 Clustering
This chapters covers
- Clustered HTTP
- Clustered Camel routes in active/passive and active/active modes
- Clustered messaging with JMS and Kafka
- Clustered caches
- Clustered scheduling
- Calling clustered services using the Service Call EIP
“How do I set up a highly available cluster with Camel?” That’s a simple question that doesn’t have a straightforward answer. You can ask the same question about a Java application server such as Apache Tomcat or WildFly and get a well-documented answer. Unlike Camel, these application servers are within a well-defined scope. They often support only a few protocols such as HTTP (Servlet) and messaging (JMS). Camel, on the other hand, speaks a lot more protocols, as you can tell by the many Camel components.
For example, a Camel application may expose a REST service and place its content into a database or filesystem. Or it may accept HL7 messages over TCP and route to a JMS broker. Or you may use Camel to stream from Kafka topics to a cloud service running on AWS. The answer to the question “How do I set up a highly available cluster with Camel?” depends on what you do with Camel.
To understand clustering support in Camel, we have to go back to the beginning. Camel was created in 2007 as a lightweight integration framework. Back then, Camel was just a set of JARs that you added to your classpath, so you could then run Camel in any JVM. Typically, you’d embed Camel into an existing application server or ESB.