Chapter 374. 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();

    // 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
        // use the zookeeper master route policy in the clustered group
        // to run this route in master/slave mode
        .log(name + " - Received file: ${file:name}")
        .log(name + " - Done file:     ${file:name}")

374.1. See Also

  • Configuring Camel
  • Component
  • Endpoint
  • Getting Started