Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
TimMoore and dwijnand Add project status to README.md (#60)
Documents this library as Supported by Lightbend.
Latest commit 55278b7 Mar 21, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
project bumped Akka version to 2.5.21 (#50) Feb 14, 2019
service-locator Improved domain name pattern (#55) Mar 15, 2019
.gitignore initial commit Oct 16, 2018
.mergify.yml Mergify to check new Travis CI check (#38) Feb 5, 2019
.scalafmt.conf configure scalafmt (#15) Dec 18, 2018
.travis.yml Build using AdoptOpenJDK 8 & 11 (#43) Feb 7, 2019
LICENSE initial commit Oct 16, 2018
README.md Add project status to README.md (#60) Mar 21, 2019
build.sbt
maven-4.0.0.xsd Build using AdoptOpenJDK 8 & 11 (#43) Feb 7, 2019

README.md

Akka Discovery based ServiceLocator

This project provides:

Additionally, you will need to choose one of the existing Akka Discovery implementations and configure it for production in your application.

Project Status

Version 1.0.0 or later of this library is ready to be used in production and its APIs are stable. It is Supported with a Lightbend Platform subscription.

Configuration for Lagom Java

For sbt users, add the dependencies to your build.sbt file:

lazy val `hello-impl` = (project in file("hello-impl"))
  .enablePlugins(LagomJava)
  .settings(
    libraryDependencies ++= Seq(
      "com.lightbend.lagom" %% "lagom-javadsl-akka-discovery-service-locator" % "1.0.0",

      // for example, include Akka Discovery Kubernetes implementation
      // see https://doc.akka.io/docs/akka/2.5/discovery/index.html
      "com.lightbend.akka.discovery" %% "akka-discovery-kubernetes-api" % "1.0.0"
    )
  )

For maven users, add the dependencies to your pom.xml

<dependency>
    <groupId>com.lightbend.lagom</groupId>
    <artifactId>lagom-javadsl-akka-discovery-service-locator_2.12</artifactId>
    <version>1.0.0</version>
</dependency>

<!--
  for example, include Akka Discovery Kubernetes implementation
  see https://doc.akka.io/docs/akka/2.5/discovery/index.html
-->
<dependency>
    <groupId>com.lightbend.akka.discovery</groupId>
    <artifactId>akka-discovery-kubernetes-api_2.12</artifactId>
    <version>1.0.0</version>
</dependency>

The Guice module AkkaDiscoveryServiceLocatorModule will be added by default to your project, but will only wire in the AkkaDiscoveryServiceLocator when running in production mode.

In development, your Lagom application will keep using the Lagom's dev-mode ServiceLocator.

Next, you will need to configure Akka Discovery in your application.conf file. Consult the Akka Discovery documentation for further instructions.

Configuration for Lagom Scala

Add the dependencies to your build.sbt file:

lazy val `hello-impl` = (project in file("hello-impl"))
  .enablePlugins(LagomScala)
  .settings(
    libraryDependencies ++= Seq(
      "com.lightbend.lagom" %% "lagom-scaladsl-akka-discovery-service-locator" % "1.0.0",

      // for example, include Akka Discovery Kubernetes implementation
      // see https://doc.akka.io/docs/akka/current/discovery/index.html
      "com.lightbend.akka.discovery" %% "akka-discovery-kubernetes-api" % "1.0.0"
    )
  )

Wire AkkaDiscoveryComponents in your ApplicationLoader:

class HelloServiceLoader extends LagomApplicationLoader {

  override def load(context: LagomApplicationContext): LagomApplication =
    new HelloProxyApplication(context) with AkkaDiscoveryComponents

  override def loadDevMode(context: LagomApplicationContext): LagomApplication =
    new HelloProxyApplication(context) with LagomDevModeComponents

  override def describeService = Some(readDescriptor[HelloService])

}

Next, you will need to configure Akka Discovery in your application.conf file. Consult the Akka Discovery documentation for further instructions.

You can’t perform that action at this time.