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

Access indexing service using a proper web client #12

Open
groldan opened this issue Oct 14, 2020 · 1 comment
Open

Access indexing service using a proper web client #12

groldan opened this issue Oct 14, 2020 · 1 comment

Comments

@groldan
Copy link
Collaborator

groldan commented Oct 14, 2020

org.fao.geonet.searching.controller.EsHttpProxy uses manual http connection handling to query the indexing service at the URL defined by ${gn.index.url}.

In order for the app to be "cloud native", it must do so in a way that supports automatic client-side load balancing, so that the value of ${gn.index.url} can be the name of the indexing service, and the load-balanced http client can discern which service instance to hit (usually it has a cache of service instances retrieved from discovery-service).

The easiest way of achieving so is using spring's WebClient (see https://spring.io/guides/gs/spring-cloud-loadbalancer/)
The recommended way is to create an OpenFeign client for the target service, which under the hood will use WebClient

@fxprunayre
Copy link
Member

fxprunayre commented Oct 15, 2020

In order for the app to be "cloud native", it must do so in a way that supports automatic client-side load balancing, so that the value of ${gn.index.url} can be the name of the indexing service, and the load-balanced http client can discern which service instance to hit (usually it has a cache of service instances retrieved from discovery-service).

The search app needs only the Elasticsearch instance. For the time being we have usually only one, but the idea is to have a cluster of 3 at least.

When using Java API, you can select an array of node to connect to
https://www.elastic.co/guide/en/elasticsearch/client/java-rest/7.9/java-rest-high-getting-started-initialization.html. So maybe we should have at some point similar config for the HTTP proxy? or a route which balance across nodes?

So the current situation is

  • Search app A > ES node1
  • Search app B > ES node1

And we should move to something like

  • Gateway /search >
    • Search app A > ES node1
    • Search app B > ES node2
      or even
  • Gateway /search >
    • Search app AorB > LoadBalance > ES node1or2

So the actions would be:

  • Gateway / Register /search route
  • Gateway / Config to balance across services
  • ES / Setup cluster
  • Search app / Define how to balance on ES nodes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants