Skip to content

Commit

Permalink
Document the options for configuring the ElasticSearch REST client
Browse files Browse the repository at this point in the history
Fixes #2502
  • Loading branch information
jamesnetherton authored and ppalaga committed Jul 21, 2021
1 parent 10197de commit 8e4c6e6
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,31 @@ Or add the coordinates to your existing project:
----

Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.

== Usage

This extension leverages the https://quarkus.io/guides/elasticsearch[Quarkus ElasticSearch REST Client].

You can choose to configure ElasticSearch via the Quarkus https://quarkus.io/guides/elasticsearch#quarkus-elasticsearch-restclient-lowlevel_configuration[configuration properties] and the `RestClient` will be autowired into the Camel ElasticSearch component.

Or you can configure ElasticSearch via the Camel ElasticSearch component / endpoint options. When doing this, you must disable autowiring in one of the ways outlined below.

Disabling autowiring at the component level.
[source,properties]
----
camel.component.elasticsearch-rest.autowired-enabled = false
----

Disabling autowiring at the endpoint level.
[source,java]
----
from("direct:search")
.to("elasticsearch-rest://elasticsearch?hostAddresses=localhost:9200&operation=Search&indexName=index&autowiredEnabled=false")
----

Globally disabling autowiring. Note that this disables autowiring for all components.
[source,properties]
----
camel.main.autowired-enabled = false
----

24 changes: 24 additions & 0 deletions extensions/elasticsearch-rest/runtime/src/main/doc/usage.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
This extension leverages the https://quarkus.io/guides/elasticsearch[Quarkus ElasticSearch REST Client].

You can choose to configure ElasticSearch via the Quarkus https://quarkus.io/guides/elasticsearch#quarkus-elasticsearch-restclient-lowlevel_configuration[configuration properties] and the `RestClient` will be autowired into the Camel ElasticSearch component.

Or you can configure ElasticSearch via the Camel ElasticSearch component / endpoint options. When doing this, you must disable autowiring in one of the ways outlined below.

Disabling autowiring at the component level.
[source,properties]
----
camel.component.elasticsearch-rest.autowired-enabled = false
----

Disabling autowiring at the endpoint level.
[source,java]
----
from("direct:search")
.to("elasticsearch-rest://elasticsearch?hostAddresses=localhost:9200&operation=Search&indexName=index&autowiredEnabled=false")
----

Globally disabling autowiring. Note that this disables autowiring for all components.
[source,properties]
----
camel.main.autowired-enabled = false
----

0 comments on commit 8e4c6e6

Please sign in to comment.