Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-17033

Camel-K ElasticsearchComponent options ignored

    XMLWordPrintable

Details

    • False
    • False
    • % %
    • Todo
    • Undefined

    Description

      When I try to configure the elasticsearch component for camel-k integration, I did the same as mentioned in camel documentation as there is nothing specific in camel-quarkus documentation.

      So I do something like:

      public class MyRouteBuilder extends RouteBuilder {
          @Override
          public void configure() throws Exception {
              ElasticsearchComponent elasticsearchComponent = new ElasticsearchComponent();
              elasticsearchComponent.setHostAddresses("my-openshift-es-service");
              elasticsearchComponent.setUser("elastic");
              elasticsearchComponent.setPassword("mypw");
              getContext().addComponent("elasticsearch-rest", elasticsearchComponent);
              from("timer:x?repeatCount=1").setBody(constant(new GetRequest("myindex").id("myid"))).to("elasticsearch-rest://elasticsearch").log("${body}");
          }
      }
      

      However, When I run the integration, all I get is connection refused. I found one thread in our chat (I will post link into the comment) where Maria had the same issue and the workaround was to disable autowiring, as the camel was using an elasticsearch client that comes from quarkus as the default client, and my options were ignored.

      I couldn't find an issue about it anywhere, so this issue is about either:

      • fixing it to use the options I specified and not some default client I don't know about
      • document how to configure it through quarkus properties so that I don't need to create the component manually
      • document that the user needs to add getContext().setAutowiredEnabled(false); to make it work

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              avano@redhat.com Andrej Vano
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: