Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-17184

camel-elasticsearch - Failed to connect with secured Elasticsearch [SSL]

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Abandoned
    • 3.12.0
    • 3.x
    • None
    • Unknown

    Description

      Hello,

      I am using Apache Camel 3.12.0 to communicate with Elasticsearch 7.13.0.
      Elasticsearch is secured i.e. SSL HTTPs protected.

      Below is the code snippet to index the data into Elasticsearch using camel.

       

      ElasticsearchComponent camelESComponent = new ElasticsearchComponent();
      camelESComponent.setHostAddresses("127.0.0.1:9200");
      camelESComponent.setUser("elastic");
      camelESComponent.setPassword("password");
      camelESComponent.setEnableSSL(true);
      camelContext.addComponent("elasticsearch-rest", camelESComponent); 
      
      // route 
      from("direct:index").to("elasticsearch-rest://myescluster?operation=Index&indexName=twitter");

      I am getting below error while performing Index operation.

      org.apache.http.ConnectionClosedException: Connection is closed
          at org.elasticsearch.client.RestClient.extractAndWrapCause(RestClient.java:871) ~[elasticsearch-rest-client-7.13.0.jar:7.13.0]
          at org.elasticsearch.client.RestClient.performRequest(RestClient.java:283) ~[elasticsearch-rest-client-7.13.0.jar:7.13.0]
          at org.elasticsearch.client.RestClient.performRequest(RestClient.java:270) ~[elasticsearch-rest-client-7.13.0.jar:7.13.0]
          at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1654) ~[elasticsearch-rest-high-level-client-7.13.0.jar:7.13.0]
          at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1624) ~[elasticsearch-rest-high-level-client-7.13.0.jar:7.13.0]
          at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:1594) ~[elasticsearch-rest-high-level-client-7.13.0.jar:7.13.0]
          at org.elasticsearch.client.RestHighLevelClient.index(RestHighLevelClient.java:1011) ~[elasticsearch-rest-high-level-client-7.13.0.jar:7.13.0]
          at org.apache.camel.component.elasticsearch.ElasticsearchProducer.process(ElasticsearchProducer.java:170) ~[camel-elasticsearch-rest-3.12.0.jar:3.12.0]
          at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:66) ~[camel-support-3.12.0.jar:3.12.0]
          at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:172) [camel-core-processor-3.12.0.jar:3.12.0]
          at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:469) [camel-core-processor-3.12.0.jar:3.12.0]
          at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.executeFromQueue(DefaultReactiveExecutor.java:210) [camel-base-engine-3.12.0.jar:3.12.0]
          at org.apache.camel.impl.engine.DefaultReactiveExecutor.executeFromQueue(DefaultReactiveExecutor.java:74) [camel-base-engine-3.12.0.jar:3.12.0]
          at org.apache.camel.impl.engine.DefaultAsyncProcessorAwaitManager.await(DefaultAsyncProcessorAwaitManager.java:96) [camel-base-engine-3.12.0.jar:3.12.0]
          at org.apache.camel.impl.engine.DefaultAsyncProcessorAwaitManager.process(DefaultAsyncProcessorAwaitManager.java:85) [camel-base-engine-3.12.0.jar:3.12.0]
          at org.apache.camel.impl.engine.SharedCamelInternalProcessor.process(SharedCamelInternalProcessor.java:108) [camel-base-engine-3.12.0.jar:3.12.0]
          at org.apache.camel.support.cache.DefaultProducerCache.send(DefaultProducerCache.java:190) [camel-support-3.12.0.jar:3.12.0]
          at org.apache.camel.impl.engine.DefaultProducerTemplate.send(DefaultProducerTemplate.java:176) [camel-base-engine-3.12.0.jar:3.12.0]
          at org.apache.camel.impl.engine.DefaultProducerTemplate.send(DefaultProducerTemplate.java:172) [camel-base-engine-3.12.0.jar:3.12.0]
          at org.apache.camel.impl.engine.DefaultProducerTemplate.requestBody(DefaultProducerTemplate.java:413) [camel-base-engine-3.12.0.jar:3.12.0] 

       

      I am getting above error when I use Camel 3.6.0 - 3.12.0 with SSL Elasticsearch. Without SSL works fine with this version.
      If I downgrade component to Camel 3.2.0 / 3.4.0/ 3.5.0 then With and Without SSL both works perfectly fine.

      Note: I verified complete end to end use case with Elasticsearch 7.8.0 [SSL Enabled], it is also failing with Camel 3.12.0 but working fine with Camel 3.2.0

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              nikhil_khode@persistent.com Nikhil
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: