lagom / lagom-akka-discovery-service-locator

Apache License 2.0
5 stars 7 forks source link

Ported to Akka 2.5.20 and reworked schema / service name mappings #29

Closed octonato closed 5 years ago

octonato commented 5 years ago

Resolves #26

ignasi35 commented 5 years ago

We've reworked this under the idea that there are 3 functions involved on a ServiceLocator.lookup call:

Only f1 and f3 fall under the responsibility oflagom-akka-discovery-service-locatorwhilef2is implemented byServiceDiscovery`.

The driver for the overhaul on this PR was to keep the settings affecting f1 and f3 separate:

  1. f1 is will use portName, protocolName and the service name and will ignore the scheme
  2. OTOH, f3 is only interested in scheme.

With this separation in mind we decided to move away from:

service-name-mappings {
  my-service-name {
    service-name = my-service.default.svc.cluster.local
    port-name = http
    protocol = udp
    scheme = https
  }
}

in favor of:

service-name-mappings {
  my-service-name {
    ## User can still overwrite the protocol and portName
    lookup = _http._tcp.my-service.default.svc.cluster.local
    ## lookup = _http._tcp.my-service
    scheme = http
  }
}