Skip to content

Commit 149e9c9

Browse files
committed
Add cluster management
1 parent 330bc2f commit 149e9c9

File tree

5 files changed

+14
-1
lines changed

5 files changed

+14
-1
lines changed

api/src/main/resources/application.conf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ akka {
2626
//DON'T USE IN PRODUCTION!!!!!
2727
auto-down-unreachable-after = 10s
2828

29+
http {
30+
management {
31+
hostname = "127.0.0.1"
32+
port = 9999
33+
}
34+
}
35+
2936
}
3037

3138
extensions = ["de.heikoseeberger.constructr.ConstructrExtension"]

api/src/main/scala/hmda/api/HmdaPlatform.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package hmda.api
33
import java.io.File
44

55
import akka.actor._
6+
import akka.cluster.Cluster
7+
import akka.cluster.http.management.ClusterHttpManagement
68
import akka.pattern.ask
79
import akka.util.Timeout
810

@@ -32,6 +34,8 @@ object HmdaPlatform {
3234
def main(args: Array[String]): Unit = {
3335

3436
val system = ActorSystem(configuration.getString("clustering.name"), configuration)
37+
val cluster = Cluster(system)
38+
ClusterHttpManagement(cluster).start()
3539
val supervisor = createSupervisor(system)
3640
val querySupervisor = createQuerySupervisor(system)
3741
implicit val ec = system.dispatcher

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
66

77
val commonDeps = Seq(logback, scalaTest, scalaCheck)
88

9-
val akkaDeps = commonDeps ++ Seq(akka, akkaCluster, akkaSlf4J, akkaStream, akkaTestkit, constructr, constructrZookeeper)
9+
val akkaDeps = commonDeps ++ Seq(akka, akkaCluster, akkaSlf4J, akkaStream, akkaTestkit, constructr, constructrZookeeper, akkaClusterManagement)
1010

1111
val akkaPersistenceDeps = akkaDeps ++ Seq(akkaPersistence, akkaStream, leveldb, leveldbjni, akkaPersistenceQuery, inMemoryPersistence, cassandraPersistence)
1212

project/Dependencies.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ object Dependencies {
1515
val akkaSlf4J = "com.typesafe.akka" %% "akka-slf4j" % Version.akka
1616
val akka = "com.typesafe.akka" %% "akka-actor" % Version.akka
1717
val akkaCluster = "com.typesafe.akka" %% "akka-cluster" % Version.akka
18+
val akkaClusterManagement = "com.lightbend.akka" %% "akka-management-cluster-http" % Version.akkaClusterManagement
1819
val akkaTestkit = "com.typesafe.akka" %% "akka-testkit" % Version.akka % "test"
1920
val akkaStream = "com.typesafe.akka" %% "akka-stream" % Version.akka
2021
val akkaPersistence = "com.typesafe.akka" %% "akka-persistence" % Version.akka

project/Version.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ object Version {
55
val scalaCheck = "1.13.4"
66
val scalaz = "7.2.9"
77
val akka = "2.4.19"
8+
val akkaClusterManagement = "0.3"
89
val akkaHttp = "10.0.8"
910
val leveldb = "0.7"
1011
val leveldbjni = "1.8"

0 commit comments

Comments
 (0)