Toggle navigation
Home
org.apache.camel.CamelContext to org.apache.camel.impl.DefaultCamelContext
No. of Instances - 8
No. of Commits - 5
No. of Projects - {'camel'}
Hierarchy/Composition: T_SUPER_R
Primitive Info: -
NameSpace: Internal -> Internal
Mapping:
Update Anonymous class
{ @Override public void configure() throws Exception { RoutePolicy policy=ClusteredRoutePolicy.forView(view); fromF("timer:%s-1?period=2s",id).routeId(id + "-1").routePolicy(policy).setHeader("ClusterMaster").body(b -> view.getMaster().getId()).log("${routeId} (1) - master is: ${header.ClusterMaster}"); fromF("timer:%s-2?period=5s",id).routeId(id + "-2").routePolicy(policy).setHeader("ClusterMaster").body(b -> view.getMaster().getId()).log("${routeId} (2) - master is: ${header.ClusterMaster}"); } }
to
{ @Override public void configure() throws Exception { CamelClusterService cluster=getContext().hasService(AtomixClusterService.class); CamelClusterView view=cluster.createView("my-view"); RoutePolicy policy=ClusteredRoutePolicy.forView(view); fromF("timer:%s-1?period=2s",id).routeId(id + "-1").routePolicy(policy).log("${routeId} (1)"); fromF("timer:%s-2?period=5s",id).routeId(id + "-2").routePolicy(policy).log("${routeId} (2)"); } }