akka / alpakka

Alpakka is a Reactive Enterprise Integration library for Java and Scala, based on Reactive Streams and Akka.

Home Page:https://doc.akka.io/docs/alpakka/current/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Replaced base uri path when using ElasticsearchSink

pramodShehan5 opened this issue · comments

Versions used

Akka version: "com.lightbend.akka" %% "akka-stream-alpakka-elasticsearch" % "6.0.2"

val sinkSettings =  ElasticsearchConnectionSettings("https://test.com:9200/elasticsearch")
      .withCredentials("", "")
  val sinkSettings =
  ElasticsearchWriteSettings(connectionSettings)
    .withBufferSize(10)
    .withRetryLogic(RetryAtFixedRate(maxRetries = 5, retryInterval = 1.second))
    .withApiVersion(ApiVersion.V5)
    .withRetryLogic(RetryAtFixedRate(maxRetries = 5, retryInterval = 1.second))
  val elasticsearchSink = ElasticsearchSink.create[DocumentStoreMetadata1](
    constructElasticsearchParams("indexname", "test", ApiVersion.V5),
    settings = sinkSettings
  )

Expected Behavior

it should be called POST https://test.com:9200/elasticsearch/_bulk

Actual Behavior

my elasticsearch base uri is https://test.com:9200/elasticsearch. it shouldn't be removed "/elasticsearch" path.

val uri = baseUri.withPath(Path(endpoint))
"_bulk" has been used in place of "elasticsearch" in this.

Relevant logs

image

Thank you for creating a PR to fix this. It must have been an oversight.