Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elasticsearch: store JSON strings #1862

Merged
merged 2 commits into from
Aug 7, 2019

Conversation

ennru
Copy link
Member

@ennru ennru commented Aug 6, 2019

Purpose

Document (Scala) and enable (Java) how to use properly formatted JSON documents without Spray or Jackson.

References

Implements #1825

Changes

  • Provide predefined StringMessageWriter
  • Allow passing MessageWriter in the Java API
  • Add sample use for Scala and Java

Background Context

#1825 asked for this support, which was available with the Scala DSL, but not the Java DSL.

@ennru ennru force-pushed the elasticsearch-write-strings branch from bb58b6e to e3a3811 Compare August 7, 2019 04:55
Copy link
Member

@2m 2m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a couple of nitpicks.

}

object StringMessageWriter extends StringMessageWriter {
val INSTANCE: StringMessageWriter = StringMessageWriter
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be called getInstance to be Java API friendly?

"_doc",
ElasticsearchWriteSettings.create().withBufferSize(5),
client,
new StringMessageWriter()))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

StringMessageWriter.getInstance() to reuse the same instance.

@ennru ennru merged commit 744706d into akka:master Aug 7, 2019
@ennru ennru deleted the elasticsearch-write-strings branch August 7, 2019 13:27
@ennru ennru added this to the 1.1.1 milestone Aug 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants