import static java.util.concurrent.TimeUnit.SECONDS;
import static org.apache.camel.component.jgroups.JGroupsExpressions.delayIfContextNotStarted;
import static org.apache.camel.component.jgroups.JGroupsFilters.dropNonCoordinatorViews;
...
from("jgroups:clusterName?enableViewMessages=true").
filter(dropNonCoordinatorViews()).
threads().delay(delayIfContextNotStarted(SECONDS.toMillis(5))). // run in separated and delayed thread. Delay only if the context hasn't been started already.
to("controlbus:route?routeId=masterRoute&action=start&async=true");
from("timer://master?repeatCount=1").routeId("masterRoute").autoStartup(false).to(masterMockUri);
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.apache.camel.component.jgroups.JGroupsExpressions.delayIfContextNotStarted;
import static org.apache.camel.component.jgroups.JGroupsFilters.dropNonCoordinatorViews;
...
from("jgroups:clusterName?enableViewMessages=true").
filter(dropNonCoordinatorViews()).
threads().delay(delayIfContextNotStarted(SECONDS.toMillis(5))). // run in separated and delayed thread. Delay only if the context hasn't been started already.
to("controlbus:route?routeId=masterRoute&action=start&async=true");
from("timer://master?repeatCount=1").routeId("masterRoute").autoStartup(false).to(masterMockUri);
Copy to ClipboardCopied!Toggle word wrapToggle overflow