Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-10269

Elasticsearch 6 UpdateRequest fail because of binary incompatibility

    Details

      Description

      When trying to send UpdateRequest(s) to ElasticSearch6, and one gets the following
      error:

      Caused by: java.lang.NoSuchMethodError:
      org.elasticsearch.action.bulk.BulkProcessor.add(Lorg/elasticsearch/action/ActionRequest;)Lorg/elasticsearch/action/bulk/BulkProcessor;
      	at
      org.apache.flink.streaming.connectors.elasticsearch.BulkProcessorIndexer.add(BulkProcessorIndexer.java:76)
      

      ElasticsearchSinkFunction:

      	import org.elasticsearch.action.update.UpdateRequest
      	def upsertRequest(element: T): UpdateRequest = {
      		new UpdateRequest(
      			"myIndex",
      			"record",
      			s"${element.id}")
      	        	.doc(element.toMap())
      	}
      	override def process(element: T, runtimeContext: RuntimeContext,
      requestIndexer: RequestIndexer): Unit = {
      		requestIndexer.add(upsertRequest(element))
      	}
      

      This is due to a binary compatibility issue between the base module (which is compiled against a very old ES version and the current Elasticsearch version).

      As a work around you can simply copy org.apache.flink.streaming.connectors.elasticsearch.BulkProcessorIndexer to your project. This should ensure that the class is compiled correctly.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                twalthr Timo Walther
                Reporter:
                twalthr Timo Walther
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: