Este contenido no está disponible en el idioma seleccionado.
Chapter 387. 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");
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");
Copy to ClipboardCopied!Toggle word wrapToggle overflow
Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.
Hacer que el código abierto sea más inclusivo
Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.
Acerca de Red Hat
Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.