[[InfluxDb-InfluxDbComponent]]
InfluxDb Component
~~~~~~~~~~~~~~~~~~~~

*Available as of Camel 2.18.0*

This component allows you to interact with InfluxDB
https://influxdata.com/time-series-platform/influxdb/ a time series database. The native body type for this component is
Point (the native influxdb class), but it can also accept Map<String, Object> as message body and it will get converted
to Point.class, please note that the map must contain an element with InfluxDbConstants.MEASUREMENT_NAME as key.

Aditionally of course you may register your own Converters to your data type to Point, or use the
(un)marshalling tools provided by camel.


From *Camel 2.18* onwards Influxdb requires Java 8.

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

[source,xml]
------------------------------------------------------------
<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-influxdb</artifactId>
    <version>x.x.x</version>
    <!-- use the same version as your Camel core version -->
</dependency>
------------------------------------------------------------

[[InfluxDb-URIformat]]
URI format
^^^^^^^^^^

[source,java]
-------------------------------
influxdb://beanName?[options]
-------------------------------

[[InfluxDb-URIOptions]]
URI Options
^^^^^^^^^^^

The producer allows sending messages to a influxdb
configured in the registry, using the native java driver.



// component options: START
The InfluxDB component has no options.
// component options: END




// endpoint options: START
The InfluxDB component supports 4 endpoint options which are listed below:

{% raw %}
[width="100%",cols="2,1,1m,1m,5",options="header"]
|=======================================================================
| Name | Group | Default | Java Type | Description
| connectionBean | producer |  | String | *Required* Name of org.influxdb.InfluxDB to use.
| databaseName | producer |  | String | Setter for databaseName
| retentionPolicy | producer | default | String | Setter for retentionPolicy
| synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
|=======================================================================
{% endraw %}
// endpoint options: END




[[InfluxDb-MessageHeaders]]
Message Headers
^^^^^^^^^^^^^^^

[width="100%",cols="10%,10%,10%,10%,60%",options="header",]
|=======================================================================
|Name |Default Value |Type |Context |Description


|=======================================================================

[[InfluxDb-Example]]
Example
^^^^^^^


Below is an example route that stores a point into the db (taking the db name from the URI)
specific key:

[source,java]
------------------------------------------------------------------------------------
from("direct:start")
        .setHeader(InfluxDbConstants.DBNAME_HEADER, constant("myTimeSeriesDB"))
        .to("influxdb://connectionBean);
------------------------------------------------------------------------------------

[source,java]
------------------------------------------------------------------------------------
from("direct:start")
        .to("influxdb://connectionBean?databaseName=myTimeSeriesDB");
------------------------------------------------------------------------------------

For more information, see these resources...

[[InfluxDb-SeeAlso]]
See Also
^^^^^^^^

* link:configuring-camel.html[Configuring Camel]
* link:component.html[Component]
* link:endpoint.html[Endpoint]
* link:getting-started.html[Getting Started]

