Show Table of Contents
Chapter 359. Master RoutePolicy
You can also use a RoutePolicy to control routes in master/slave mode.
When doing so you must configure the route policy with
- url to zookeeper ensemble
- name of cluster group
- important and set the route to not auto startup
A little example
MasterRoutePolicy master = new MasterRoutePolicy();
master.setZooKeeperUrl("localhost:2181");
master.setGroupName("myGroup");
// its import to set the route to not auto startup
// as we let the route policy start/stop the routes when it becomes a master/slave etc
from("file:target/inbox?delete=true").noAutoStartup()
// use the zookeeper master route policy in the clustered group
// to run this route in master/slave mode
.routePolicy(master)
.log(name + " - Received file: ${file:name}")
.delay(delay)
.log(name + " - Done file: ${file:name}")
.to("file:target/outbox");359.1. See Also
- Configuring Camel
- Component
- Endpoint
- Getting Started

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.