Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id EBFB1200C85 for ; Mon, 24 Apr 2017 18:59:56 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E997A160BA5; Mon, 24 Apr 2017 16:59:56 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 42556160BB5 for ; Mon, 24 Apr 2017 18:59:56 +0200 (CEST) Received: (qmail 7887 invoked by uid 500); 24 Apr 2017 16:59:55 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 7792 invoked by uid 99); 24 Apr 2017 16:59:55 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Apr 2017 16:59:55 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4D7D5E110C; Mon, 24 Apr 2017 16:59:55 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: lburgazzoli@apache.org To: commits@camel.apache.org Date: Mon, 24 Apr 2017 17:00:00 -0000 Message-Id: <28a62c417e3148779aac5b5311949ea9@git.apache.org> In-Reply-To: <56a34cc98a2c4e73bcefaa68dd0420d1@git.apache.org> References: <56a34cc98a2c4e73bcefaa68dd0420d1@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [6/8] camel git commit: ServiceCall: improve EIP documentation archived-at: Mon, 24 Apr 2017 16:59:57 -0000 ServiceCall: improve EIP documentation Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/419cbdc1 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/419cbdc1 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/419cbdc1 Branch: refs/heads/master Commit: 419cbdc1dac00fcf5bc86ad4179c33ea00cc8149 Parents: 4b97e0a Author: lburgazzoli Authored: Mon Apr 24 17:29:21 2017 +0200 Committer: lburgazzoli Committed: Mon Apr 24 17:29:21 2017 +0200 ---------------------------------------------------------------------- .../src/main/docs/eips/serviceCall-eip.adoc | 104 +++++++++++++++++++ 1 file changed, 104 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/419cbdc1/camel-core/src/main/docs/eips/serviceCall-eip.adoc ---------------------------------------------------------------------- diff --git a/camel-core/src/main/docs/eips/serviceCall-eip.adoc b/camel-core/src/main/docs/eips/serviceCall-eip.adoc index 0874eef..0925c6b 100644 --- a/camel-core/src/main/docs/eips/serviceCall-eip.adoc +++ b/camel-core/src/main/docs/eips/serviceCall-eip.adoc @@ -115,6 +115,56 @@ The Service Call EIP can be configured through the following options: In addition to ref/binding configuration style you can leverage specific configuration DSL to customize specific options: +* *Static Service Discovery:* ++ +This service discovery implementation does not query any external services to find out the list of services associated to a named service but keep them in memory. Each service should be provided in the following form: ++ +[source] +---- + [service@]host:port +---- ++ +TIP: The ``service`` part is used to discrimintate aginst the services but if not provided it acks like a wildcard so each non named service will be returned whatever the service name is. This is useful if you ahve a single service so the service name is redundant. ++ +NOTE: this implementation is provided by ``camel-core`` artifact. ++ +*Available options:* ++ +[width="100%",cols="3,1m,6",options="header"] +|======================================================================= +| Name | Java Type | Description +| servers | String | A comma separated list of servers in the form: [service@]host:port,[service@]host2:port,[service@]host3:port +|======================================================================= ++ +[source,java] +.Java DSL Example +---- +from("direct:start") + .serviceCall("foo") + .staticServiceDiscovery() + .servers("service1@host1:80,service1@host2:80") + .servers("service2@host1:8080,service2@host2:8080,service2@host3:8080") + .end() + .to("mock:result"); +---- ++ +[source,xml] +.XML DSL Example +---- + + + + + + service1@host1:80,service1@host2:80 + service2@host1:8080,service2@host2:8080,service2@host3:8080 + + + + +---- + * *Consul Service Discovery:* + To leverage Consul for Service Discover, maven users will need to add the following dependency to their pom.xml @@ -334,6 +384,60 @@ from("direct:start") ---- +* *Blacklist Service Filter:* ++ +This service filter implementation removes the listed services from those found by the service discovery. Each service should be provided in the following form: ++ +[source] +---- + [service@]host:port +---- ++ +NOTE: The services are removed if they fully match. ++ +*Available options:* ++ +[width="100%",cols="3,1m,6",options="header"] +|======================================================================= +| Name | Java Type | Description +| servers | String | A comma separated list of servers to blacklist: [service@]host:port,[service@]host2:port,[service@]host3:port +|======================================================================= ++ +[source,java] +.Java DSL Example +---- +from("direct:start") + .serviceCall("foo") + .staticServiceDiscovery() + .servers("service1@host1:80,service1@host2:80") + .servers("service2@host1:8080,service2@host2:8080,service2@host3:8080") + .end() + .blacklistFilter() + .servers("service2@host2:8080") + .end() + .to("mock:result"); +---- ++ +[source,xml] +.XML DSL Example +---- + + + + + + service1@host1:80,service1@host2:80 + service2@host1:8080,service2@host2:8080,service2@host3:8080 + + + service2@host2:8080 + + + + +---- + ### Load Balancer The Service Call EIP comes with its own Load Balancer which is istantiated by default if a custome one is not configured and glues Service Discovery, Service Filer, Service Chooser and Service Expression togheter to load balance requests among the available services.