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 2021/05/01 12:05:42 UTC
[camel] branch main updated: Regen for commit
7a3bcc88398c896e389ce9e2b32cddb3721acdde
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new f459d11 Regen for commit 7a3bcc88398c896e389ce9e2b32cddb3721acdde
f459d11 is described below
commit f459d11e59901a4a2958e0b36167b1931b299aed
Author: davsclaus <da...@users.noreply.github.com>
AuthorDate: Sat May 1 11:37:49 2021 +0000
Regen for commit 7a3bcc88398c896e389ce9e2b32cddb3721acdde
Signed-off-by: GitHub <no...@github.com>
---
.../camel/catalog/docs/consul-component.adoc | 64 ++++++++++++++++++++++
.../modules/ROOT/pages/consul-component.adoc | 64 ++++++++++++++++++++++
2 files changed, 128 insertions(+)
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/consul-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/consul-component.adoc
index f387d06..2b92ad9 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/consul-component.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/consul-component.adoc
@@ -171,6 +171,70 @@ with the following path and query parameters:
|CamelConsulResult|boolean|true if the response has a result
|CamelConsulSession|String|The session id
|CamelConsulValueAsString|boolean|To transform values retrieved from Consul i.e. on KV endpoint to string.
+|CamelConsulServiceId|String|The service id for agent deregistration
|=======================================================================
+== Api Endpoint
+
+The `apiEndpoint` denotes the type of https://www.consul.io/api-docs[consul api] which should be addressed.
+
+[width="100%",options="header"]
+|===
+| Domain | Producer | Consumer
+| kv | ConsulKeyValueProducer | ConsulKeyValueConsumer
+| event | ConsulEventProducer | ConsulEventConsumer
+| agent | ConsulAgentProducer | -
+| coordinates | ConsulCoordinatesProducer | -
+| health | ConsulHealthProducer | -
+| status | ConsulStatusProducer | -
+| preparedQuery | ConsulPreparedQueryProducer | -
+| catalog | ConsulCatalogProducer | -
+| session | ConsulSessionProducer | -
+|===
+
+== Producer Examples
+
+As an example, we will show how to use the `ConsulAgentProducer` to register a service by means of the Consul agent api.
+
+Registering and deregistering are examples for possible actions against the Consul agent api.
+
+The desired action can be defined by setting the header `ConsulConstants.CONSUL_ACTION` to a value from the `ConsulXXXActions` interface of the respective Consul api. E.g. `ConsulAgentActions` contains the actions for the agent api.
+
+If you set `CONSUL_ACTION` to `ConsulAgentActions.REGISTER`, the agent action `REGISTER` will be executed.
+
+TIP: Which producer action invokes which consul api is defined by the respective producer.
+E.g. the `ConsulAgentProducer` maps `ConsulAgentActions.REGISTER` to an invocation of `AgentClient.register`.
+
+[source,java]
+----
+from("direct:registerFooService")
+ .setBody().constant(ImmutableRegistration.builder()
+ .id("foo-1")
+ .name("foo")
+ .address("localhost")
+ .port(80)
+ .build())
+ .setHeader(ConsulConstants.CONSUL_ACTION, constant(ConsulAgentActions.REGISTER))
+ .to("consul:agent");
+----
+
+It is also possible to set a default action on the consul endpoint and do without the header:
+
+----
+consul:agent?action=REGISTER
+----
+
+== Registering Camel Routes with Consul
+
+You can employ a `ServiceRegistrationRoutePolicy` to register Camel routes as services with Consul automatically.
+
+[source,java]
+----
+from("jetty:http://0.0.0.0:8080/service/endpoint").routeId("foo-1")
+ .routeProperty(ServiceDefinition.SERVICE_META_ID, "foo-1")
+ .routeProperty(ServiceDefinition.SERVICE_META_NAME, "foo")
+ .routePolicy(new ServiceRegistrationRoutePolicy())
+...
+----
+
include::{page-component-version}@camel-spring-boot::page$consul-starter.adoc[]
diff --git a/docs/components/modules/ROOT/pages/consul-component.adoc b/docs/components/modules/ROOT/pages/consul-component.adoc
index fd18c9b..3674eac 100644
--- a/docs/components/modules/ROOT/pages/consul-component.adoc
+++ b/docs/components/modules/ROOT/pages/consul-component.adoc
@@ -173,6 +173,70 @@ with the following path and query parameters:
|CamelConsulResult|boolean|true if the response has a result
|CamelConsulSession|String|The session id
|CamelConsulValueAsString|boolean|To transform values retrieved from Consul i.e. on KV endpoint to string.
+|CamelConsulServiceId|String|The service id for agent deregistration
|=======================================================================
+== Api Endpoint
+
+The `apiEndpoint` denotes the type of https://www.consul.io/api-docs[consul api] which should be addressed.
+
+[width="100%",options="header"]
+|===
+| Domain | Producer | Consumer
+| kv | ConsulKeyValueProducer | ConsulKeyValueConsumer
+| event | ConsulEventProducer | ConsulEventConsumer
+| agent | ConsulAgentProducer | -
+| coordinates | ConsulCoordinatesProducer | -
+| health | ConsulHealthProducer | -
+| status | ConsulStatusProducer | -
+| preparedQuery | ConsulPreparedQueryProducer | -
+| catalog | ConsulCatalogProducer | -
+| session | ConsulSessionProducer | -
+|===
+
+== Producer Examples
+
+As an example, we will show how to use the `ConsulAgentProducer` to register a service by means of the Consul agent api.
+
+Registering and deregistering are examples for possible actions against the Consul agent api.
+
+The desired action can be defined by setting the header `ConsulConstants.CONSUL_ACTION` to a value from the `ConsulXXXActions` interface of the respective Consul api. E.g. `ConsulAgentActions` contains the actions for the agent api.
+
+If you set `CONSUL_ACTION` to `ConsulAgentActions.REGISTER`, the agent action `REGISTER` will be executed.
+
+TIP: Which producer action invokes which consul api is defined by the respective producer.
+E.g. the `ConsulAgentProducer` maps `ConsulAgentActions.REGISTER` to an invocation of `AgentClient.register`.
+
+[source,java]
+----
+from("direct:registerFooService")
+ .setBody().constant(ImmutableRegistration.builder()
+ .id("foo-1")
+ .name("foo")
+ .address("localhost")
+ .port(80)
+ .build())
+ .setHeader(ConsulConstants.CONSUL_ACTION, constant(ConsulAgentActions.REGISTER))
+ .to("consul:agent");
+----
+
+It is also possible to set a default action on the consul endpoint and do without the header:
+
+----
+consul:agent?action=REGISTER
+----
+
+== Registering Camel Routes with Consul
+
+You can employ a `ServiceRegistrationRoutePolicy` to register Camel routes as services with Consul automatically.
+
+[source,java]
+----
+from("jetty:http://0.0.0.0:8080/service/endpoint").routeId("foo-1")
+ .routeProperty(ServiceDefinition.SERVICE_META_ID, "foo-1")
+ .routeProperty(ServiceDefinition.SERVICE_META_NAME, "foo")
+ .routePolicy(new ServiceRegistrationRoutePolicy())
+...
+----
+
include::{page-component-version}@camel-spring-boot::page$consul-starter.adoc[]