public void boot() throws Exception { // create and embed the hazelcast server // (you can use the hazelcast client if you want to connect to external hazelcast server) HazelcastInstance hz = Hazelcast.newHazelcastInstance(); // setup the hazelcast idempotent repository which we will use in the route HazelcastIdempotentRepository repo = new HazelcastIdempotentRepository(hz, "camel"); main = new Main(); // bind the hazelcast repository to the name myRepo which we refer to from the route main.bind("myRepo", repo); // add the route and and let the route be named BAR and use a little delay when processing the files main.addRouteBuilder(new FileConsumerRoute("BAR", 100)); main.run(); }
public void boot() throws Exception { // create and embed the hazelcast server // (you can use the hazelcast client if you want to connect to external hazelcast server) HazelcastInstance hz = Hazelcast.newHazelcastInstance(); // setup the hazelcast idempotent repository which we will use in the route HazelcastIdempotentRepository repo = new HazelcastIdempotentRepository(hz, "camel"); main = new Main(); // bind the hazelcast repository to the name myRepo which we refer to from the route main.bind("myRepo", repo); // add the route and and let the route be named BAR and use a little delay when processing the files main.addRouteBuilder(new FileConsumerRoute("FOO", 100)); main.run(); }
public void boot() throws Exception { main = new Main(); // the default zookeeper url is localhost:2181 MasterComponent master = new MasterComponent(); master.setZooKeeperUrl("localhost:2181"); main.bind("zookeeper-master", master); // add the route and and let the route be named Bar and use a little delay when processing the files main.addRouteBuilder(new FileConsumerRoute("Bar", 200)); main.run(); }
public void boot() throws Exception { main = new Main(); // the default zookeeper url is localhost:2181 MasterComponent master = new MasterComponent(); master.setZooKeeperUrl("localhost:2181"); main.bind("zookeeper-master", master); // add the route and and let the route be named Bar and use a little delay when processing the files main.addRouteBuilder(new FileConsumerRoute("Foo", 200)); main.run(); }
public void boot() throws Exception { // setup the hazelcast route policy ConsulRoutePolicy routePolicy = new ConsulRoutePolicy(); // the service names must be same in the foo and bar server routePolicy.setServiceName("myLock"); routePolicy.setTtl(5); main = new Main(); // bind the hazelcast route policy to the name myPolicy which we refer to from the route main.bind("myPolicy", routePolicy); // add the route and and let the route be named Bar and use a little delay when processing the files main.addRouteBuilder(new FileConsumerRoute("Foo", 100)); main.run(); }
public void boot() throws Exception { main = new Main(); // the default zookeeper url is localhost:2181 MasterRoutePolicy master = new MasterRoutePolicy(); master.setZooKeeperUrl("localhost:2181"); master.setGroupName("myGroup"); main.bind("zookeeper-master-policy", master); // add the route and and let the route be named Bar and use a little delay when processing the files main.addRouteBuilder(new FileConsumerRoute("Foo", 200)); main.run(); }
public void boot() throws Exception { main = new Main(); // the default zookeeper url is localhost:2181 MasterRoutePolicy master = new MasterRoutePolicy(); master.setZooKeeperUrl("localhost:2181"); master.setGroupName("myGroup"); main.bind("zookeeper-master-policy", master); // add the route and and let the route be named Bar and use a little delay when processing the files main.addRouteBuilder(new FileConsumerRoute("Bar", 200)); main.run(); }
public void boot() throws Exception { // setup the hazelcast route policy ConsulRoutePolicy routePolicy = new ConsulRoutePolicy(); // the service names must be same in the foo and bar server routePolicy.setServiceName("myLock"); routePolicy.setTtl(5); main = new Main(); // bind the hazelcast route policy to the name myPolicy which we refer to from the route main.bind("myPolicy", routePolicy); // add the route and and let the route be named Bar and use a little delay when processing the files main.addRouteBuilder(new FileConsumerRoute("Bar", 100)); main.run(); }
public void boot() throws Exception { // create and embed the hazelcast server // (you can use the hazelcast client if you want to connect to external hazelcast server) HazelcastInstance hz = Hazelcast.newHazelcastInstance(); // setup the hazelcast route policy HazelcastRoutePolicy routePolicy = new HazelcastRoutePolicy(hz); // the lock names must be same in the foo and bar server routePolicy.setLockMapName("myLock"); routePolicy.setLockKey("myLockKey"); routePolicy.setLockValue("myLockValue"); // attempt to grab lock every 5th second routePolicy.setTryLockTimeout(5, TimeUnit.SECONDS); main = new Main(); // bind the hazelcast route policy to the name myPolicy which we refer to from the route main.bind("myPolicy", routePolicy); // add the route and and let the route be named Bar and use a little delay when processing the files main.addRouteBuilder(new FileConsumerRoute("Foo", 100)); main.run(); }
public void boot() throws Exception { // create and embed the hazelcast server // (you can use the hazelcast client if you want to connect to external hazelcast server) HazelcastInstance hz = Hazelcast.newHazelcastInstance(); // setup the hazelcast route policy HazelcastRoutePolicy routePolicy = new HazelcastRoutePolicy(hz); // the lock names must be same in the foo and bar server routePolicy.setLockMapName("myLock"); routePolicy.setLockKey("myLockKey"); routePolicy.setLockValue("myLockValue"); // attempt to grab lock every 5th second routePolicy.setTryLockTimeout(5, TimeUnit.SECONDS); main = new Main(); // bind the hazelcast route policy to the name myPolicy which we refer to from the route main.bind("myPolicy", routePolicy); // add the route and and let the route be named Bar and use a little delay when processing the files main.addRouteBuilder(new FileConsumerRoute("Bar", 100)); main.run(); }
main.addRouteBuilder(new FileConsumerRoute("Bar", 100)); main.run();
main.addRouteBuilder(new FileConsumerRoute("Foo", 100)); main.run();