You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2018/11/08 15:07:05 UTC
[camel] branch master updated: Improved doc to use master api for
singleton route usecase, fix CAMEL-12922 (#2606)
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new 3cbbf35 Improved doc to use master api for singleton route usecase, fix CAMEL-12922 (#2606)
3cbbf35 is described below
commit 3cbbf356885199b60e349fddf62f115dc9030cb2
Author: Andrea Tarocchi <an...@gmail.com>
AuthorDate: Thu Nov 8 16:06:58 2018 +0100
Improved doc to use master api for singleton route usecase, fix CAMEL-12922 (#2606)
---
.../camel-jgroups/src/main/docs/jgroups-component.adoc | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/components/camel-jgroups/src/main/docs/jgroups-component.adoc b/components/camel-jgroups/src/main/docs/jgroups-component.adoc
index cc7bee6..b935ed9 100644
--- a/components/camel-jgroups/src/main/docs/jgroups-component.adoc
+++ b/components/camel-jgroups/src/main/docs/jgroups-component.adoc
@@ -290,14 +290,10 @@ address` http://localhost:8080/orders`.
[source,java]
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
-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;
+JGroupsLockClusterService service = new JGroupsLockClusterService();
+service.setId("uniqueNodeId");
...
-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");
+context.addService(service);
-from("jetty:http://localhost:8080/orders").routeId("masterRoute").autoStartup(false).to("jms:orders");
+from("master:mycluster:jetty:http://localhost:8080/orders").to("jms:orders");
-----------------------------------------------------------------------------------------------------------------------------------------------------------------