Consul  is a distributed, highly available, datacenter-aware, service discovery and configuration system.

Maven users will need to add the following dependency to their pom.xml for this component.

 

URI format

Where apiEnpoint represents the consul's HTTP API the consul-component should operate on: 

Supported HTTP API are:

 

Options

Name

Group

Default

Java Type

Description

url

common

 

String

Defines the URIs the component should connect to.

keycommon StringThe default key. Can be overridden by CamelConsulKey
actionproducer StringThe default action. Can be overridden by CamelConsulAction
pingInstancecommontruebooleanConfigure if the AgentClient should attempt a ping before returning the Consul instance
valueAsStringcommonfalsebooleanDefault to transform values retrieved from Consul i.e. on KV endpoint to string.
connectTimeoutMilliscommon LongConnect timeout for OkHttpClient
readTimeoutMilliscommon LongRead timeout for OkHttpClient
writeTimeoutMilliscommon LongWrite timeout for OkHttpClient
sslContextParameterssecurity SSLContextParametersSSL configuration using an org.apache.camel.util.jsse.SSLContextParameters instance
userNamesecurity StringSets the username to be used for basic authentication
passwordsecurity StringSets the password to be used for basic authentication
aclTokensecurity StringSets the ACL token to be used with Consul
blockSecondsconsumer, watch10IntegerThe second to wait for a watch event default 10 seconds
firstIndexconsumer, watch0LongThe first index to watch for
recursiveconsumer, watchfalsebooleanRecursively watch

 

Headers

NameJava TypeDescription
CamelConsulActionStringThe action to perform
CamelConsulKeyStringThe Key on which the action should be applied
CamelConsulEventIdStringThe event id 
CamelConsulEventNameStringThe event name
CamelConsulEventLTimeLongThe event ltime
CamelConsulNodeFilterStringThe node filter
CamelConsulTagFilterStringThe tag filter
CamelConsulSessionFilterStringThe session filter
CamelConsulVersionIntegerThe data version
CamelConsulFlagsLongFlags associated with a value
CamelConsulCreateIndexLongThe internal index value that represents when the entry was created
CamelConsulLockIndexLongThe number of times this key has successfully been acquired in a lock
CamelConsulModifyIndexLongThe last index that modified this key
CamelConsulOptionsObjectOptions associated to the request
CamelConsulResultBooleantrue if the response has a result
CamelConsulSessionStringThe session id
CamelConsulValueAsStringBooleanTo transform values retrieved from Consul i.e. on KV endpoint to string.

 

KV API example:

 

Watch API example:

 

 

 

 

© 2004-2015 The Apache Software Foundation.
Apache Camel, Camel, Apache, the Apache feather logo, and the Apache Camel project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
Graphic Design By Hiram