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

TCP Client to ES Deprecated - Switch to HTTP #34

Closed
bacoboy opened this issue Oct 6, 2017 · 5 comments
Closed

TCP Client to ES Deprecated - Switch to HTTP #34

bacoboy opened this issue Oct 6, 2017 · 5 comments
Assignees
Milestone

Comments

@bacoboy
Copy link

bacoboy commented Oct 6, 2017

The elastic4s TCPClient you are using to communicate with ElasticSearch has deprecated the TCPClient in favor of the HTTPClient. It will be removed in the next major version of elastic4s which already has a first release candidate.

According to the README they say you can just swap out the import paths from elastic-tcp to elastic-http and change code uses of TCPClient to HTTPClient. That said, there is a warning about the responses being different from client.execute() so the change is a little more involved:

Requests are the same for either client, but response classes may vary slightly as the HTTP response classes model the returned JSON whereas the TCP response classes wrap the Java client classes

Once complete and added to TheHive, people can insert an aws authenticating proxy to use AWS Hosted ElasticSearch ending a standoff between TheHive developers and AWS dogma. Apparently support for a signed http transport in elastic4s is in the works.

Ideally a pluggable transport would allow people to pick and choose (tcp, http, http-aws) rather than be dictated to them.

Anyway this isn't about AWS ES but the TCP transport going away in the library you are using. Better to start a discussion about what to do and when than wait until the code atrophies.

@To-om
Copy link
Contributor

To-om commented Oct 18, 2017

Hi @bacoboy,

Several week ago, I've tried to add support of elastic4s HTTP client to Elastic4play but some operations were not supported. I've updated elastic4s version and it works better but there are many problems to support both TCP and HTTP.
The main problem is that the result of an operation (a search for example) doesn't return the class. TCP client returns a com.sksamuel.elastic4s.searches.RichSearchResponse whereas HTTP client returns a com.sksamuel.elastic4s.http.search.SearchResponse and conversion between the two types is not possible (they doesn't contain the same data).
In order to support HTTP and TCP, I must add an abstraction layer on operation results.

For you information, we have many problems with ElasticSearch and we seriously think about migration to another database technology. But migration to a new database is not an easy task and will take time.

@To-om To-om self-assigned this Oct 18, 2017
@To-om To-om added the question label Oct 18, 2017
@bacoboy
Copy link
Author

bacoboy commented Oct 19, 2017

Yes, because you are using the the result classes directly you would have to create an abstraction layer anyway -- in which case you could support a plugable persistence layer -- including a standard database.

@dcode
Copy link

dcode commented Feb 11, 2018

@To-om does 5e2e12b fully implement the HTTP transport, or is there more to do. I'm ultimately keen to update TheHive to use an ES 6.x backend, but it seems the TCP transport and Netty dependencies are the stopper for that. Maybe there's other issues, but I thought I'd ask.

I'm happy to test and provide useful feedback. I use Elastic extensively with the @rocknsm project and I'm looking to update my entire cluster to 6.x.

Thanks!

@slatemine
Copy link

+1
@To-om does 5e2e12b fully implement the HTTP transport
This issue, we're in the process of spinning up a production cluster and were going with AWS Elasticsearch just to provide a quick low maintenance ES cluster ( daily back up etc ). Anyhow AWS does not support TCP clients.

I see the branch on which this work was done stopped, was it successful or a dead end.

@To-om
Copy link
Contributor

To-om commented May 15, 2019

From version 1.11, HTTP communication is used. TCPClient is not used any longer.

@To-om To-om closed this as completed May 15, 2019
@To-om To-om added this to the 1.11 milestone May 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants