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

Use Service Discovery #137

Closed
ignasi35 opened this issue Mar 29, 2018 · 8 comments
Closed

Use Service Discovery #137

ignasi35 opened this issue Mar 29, 2018 · 8 comments
Assignees
Milestone

Comments

@ignasi35
Copy link
Member

Use Service discovery so host:port are not hardcoded.

@ktoso
Copy link
Member

ktoso commented Mar 29, 2018

Relates to managed calls I think... Agree, should be able to plug in some client-side load balancing or similar mechanisms using however we decide to make this pluggable

@raboof
Copy link
Member

raboof commented Mar 29, 2018

Is this something we'd want to consider when designing the akka-http API's for client-side HTTP2 support? Previously it seemed we'd need little API changes (just implementation), does this mean we should revisit that?

@ktoso
Copy link
Member

ktoso commented Mar 29, 2018

Perhaps, though it's not like HTTP/2 is "new API" really, it should mirror the HTTP one. So it is more about Akka HTTP clientside perhaps needing something. Though in general I think this belongs into the managed calls... Perhaps we need the client report back things to the managed calls, like "errors keep happening on this connection" and the managed calls would decide to try a new host or something.

@ignasi35
Copy link
Member Author

Did some investigation recently: https://github.com/ignasi35/akka-grpc-labs

The issue spans into Channel pooling.

NOTE: I use the name Channel since that's the gRPC naming convention (beyond language or implementation details) and not because that's the current implementation.

@ignasi35
Copy link
Member Author

ignasi35 commented Mar 29, 2018

Is this something we'd want to consider when designing the akka-http API's for client-side HTTP2 support?

@raboof I'm not familiar with Akka HTTP client pooling connections but this is highly related. Multiplexing traffic over a Channel just adds a bit more complexity since a Channel is suddenly used for unary and streamed calls all at once and the lifecycle management gets tricker.

@ignasi35
Copy link
Member Author

side note: I poked into this as part of spiking the needs to use akka-grpc in lagom. See more lab work specific to lagom at https://github.com/ignasi35/lagom-grpc-labs

@ignasi35
Copy link
Member Author

Previously it seemed we'd need little API changes (just implementation), does this mean we should revisit that?

I think so. I think the ServiceClient should get a ServiceDiscovery instance which could default to HardcodedServiceDiscovery.

Alternatively we could provide more generators:

  • default generator provides a ServiceClient(Channel)
  • discovery generator provides a ServiceClient(...) which given a ChannelProvider (pool, service discovery, circuit breaking,...) wraps calls.

@ktoso
Copy link
Member

ktoso commented Mar 29, 2018

I think so. I think the ServiceClient should get a ServiceDiscovery instance which could default to HardcodedServiceDiscovery.

Yes, sound right -- to clarify though: that is not Akka HTTP Client API changes though, which was Arnout's question as I understood it.

The discovery could be provided by the "managed calls" (they really need a working name... this sounds too limiting to what this is aimed to be doing) as it would want to decide based on feedback based on some SPI from the Akka Client that "oh man, that endpoint is failing a lot! Let's try another one". The client here would continue issuing requests via the resolved address -- which would be managed by the managed-calls -- so it would, hopefully, not know anything about the "managing" actually happening.

Though that's my speculation for now... I hope we can keep them detached as much as possible, but we'll see how it goes

@chbatey chbatey self-assigned this Jun 25, 2018
ignasi35 pushed a commit to lagom/lagom that referenced this issue Jul 24, 2018
## Fixes

Fixes #1426

## Background Context

The [Akka Management](https://developer.lightbend.com/docs/akka-management/current/) library recently introduced a new component for [Service Discovery](https://developer.lightbend.com/docs/akka-management/current/discovery.html). This is used as the basis of [Akka Cluster Bootstrap](https://developer.lightbend.com/docs/akka-management/current/bootstrap.html), to help service nodes locate each other when forming a cluster, but is intended to be used in many other contexts in the future, including typical service-to-service communication scenarios (such as in [Akka gRPC](https://github.com/akka/akka-grpc), see akka/akka-grpc#137).

We hope to make Akka Service Discovery into the fundamental service discovery API for all of the Lightbend Reactive Platform (Akka, Lagom and Play) and eventually migrate away from Lagom's `ServiceLocator` API. As a first step, we are providing a compatibility in Lagom's development mode, so that Akka Service Discovery works seamlessly with the built-in service registry. This will allow Akka gRPC and any other libraries that use Akka Service Discovery to automatically discover other services that are run in the same `runAll` command.

## References

- #1291 is related, but the reverse: providing a Lagom `ServiceLocator` implementation that is backed by Akka Service Discovery, allowing use of Akka Service Discovery methods in Lagom (such as the [Consul method](https://developer.lightbend.com/docs/akka-management/current/discovery.html)).
@chbatey chbatey added this to the 0.2 milestone Jul 26, 2018
@chbatey chbatey closed this as completed Jul 26, 2018
denis554 added a commit to denis554/lagom that referenced this issue Apr 9, 2019
## Fixes

Fixes #1426

## Background Context

The [Akka Management](https://developer.lightbend.com/docs/akka-management/current/) library recently introduced a new component for [Service Discovery](https://developer.lightbend.com/docs/akka-management/current/discovery.html). This is used as the basis of [Akka Cluster Bootstrap](https://developer.lightbend.com/docs/akka-management/current/bootstrap.html), to help service nodes locate each other when forming a cluster, but is intended to be used in many other contexts in the future, including typical service-to-service communication scenarios (such as in [Akka gRPC](https://github.com/akka/akka-grpc), see akka/akka-grpc#137).

We hope to make Akka Service Discovery into the fundamental service discovery API for all of the Lightbend Reactive Platform (Akka, Lagom and Play) and eventually migrate away from Lagom's `ServiceLocator` API. As a first step, we are providing a compatibility in Lagom's development mode, so that Akka Service Discovery works seamlessly with the built-in service registry. This will allow Akka gRPC and any other libraries that use Akka Service Discovery to automatically discover other services that are run in the same `runAll` command.

## References

- #1291 is related, but the reverse: providing a Lagom `ServiceLocator` implementation that is backed by Akka Service Discovery, allowing use of Akka Service Discovery methods in Lagom (such as the [Consul method](https://developer.lightbend.com/docs/akka-management/current/discovery.html)).
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

4 participants