From 9196039f038c3c5603b2b3b082e8170def881115 Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Sun, 9 Feb 2020 16:18:13 -0300 Subject: [PATCH 1/4] Fix tag --- docs/src/main/paradox/user/lang/java/gettingstarted.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/main/paradox/user/lang/java/gettingstarted.md b/docs/src/main/paradox/user/lang/java/gettingstarted.md index 75fd5e43c..07811b884 100644 --- a/docs/src/main/paradox/user/lang/java/gettingstarted.md +++ b/docs/src/main/paradox/user/lang/java/gettingstarted.md @@ -19,11 +19,11 @@ In addition to the above, you will need to install the CloudState java support l Maven : @@@vars ```xml - + io.cloudstate cloudstate-java-support $cloudstate.java-support.version$ - + ``` @@@ From 7ba2560f91634067d1d765ed17da425824b90cd2 Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Sun, 9 Feb 2020 16:21:18 -0300 Subject: [PATCH 2/4] Fix tag --- docs/src/main/paradox/user/lang/java/gettingstarted.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/main/paradox/user/lang/java/gettingstarted.md b/docs/src/main/paradox/user/lang/java/gettingstarted.md index 373f61fc4..dbdcac108 100644 --- a/docs/src/main/paradox/user/lang/java/gettingstarted.md +++ b/docs/src/main/paradox/user/lang/java/gettingstarted.md @@ -19,11 +19,11 @@ In addition to the above, you will need to install the Cloudstate java support l Maven : @@@vars ```xml - + io.cloudstate cloudstate-java-support $cloudstate.java-support.version$ - + ``` @@@ From b145ae996f646a815d97a137d6a0e41d49037737 Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Mon, 10 Feb 2020 15:01:20 -0300 Subject: [PATCH 3/4] Settings ServiceInfo in order to enable the reuse of java-support in other JVM languages --- .../io/cloudstate/javasupport/impl/EntityDiscoveryImpl.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java-support/src/main/scala/io/cloudstate/javasupport/impl/EntityDiscoveryImpl.scala b/java-support/src/main/scala/io/cloudstate/javasupport/impl/EntityDiscoveryImpl.scala index a16fc1483..baa1831eb 100644 --- a/java-support/src/main/scala/io/cloudstate/javasupport/impl/EntityDiscoveryImpl.scala +++ b/java-support/src/main/scala/io/cloudstate/javasupport/impl/EntityDiscoveryImpl.scala @@ -28,8 +28,8 @@ class EntityDiscoveryImpl(system: ActorSystem, services: Map[String, StatefulSer private val serviceInfo = ServiceInfo( serviceRuntime = sys.props.getOrElse("java.runtime.name", "") + " " + sys.props.getOrElse("java.runtime.version", ""), - supportLibraryName = BuildInfo.name, - supportLibraryVersion = BuildInfo.version + supportLibraryName = sys.env.getOrElse("SUPPORT_LIBRARY_NAME", BuildInfo.name), + supportLibraryVersion = sys.env.getOrElse("SUPPORT_LIBRARY_VERSION", BuildInfo.version) ) /** From d189e39affa0d3afc207eb1896301e3e6cb8297f Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Wed, 12 Feb 2020 10:12:09 -0300 Subject: [PATCH 4/4] Add support to get library name and version from HOCON config file --- java-support/src/main/resources/reference.conf | 6 ++++++ .../cloudstate/javasupport/impl/EntityDiscoveryImpl.scala | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/java-support/src/main/resources/reference.conf b/java-support/src/main/resources/reference.conf index e6bfbe6fe..2a220fb21 100644 --- a/java-support/src/main/resources/reference.conf +++ b/java-support/src/main/resources/reference.conf @@ -1,4 +1,10 @@ cloudstate { + + library { + name = "cloudstate-java-support" + version = "0.4.3" + } + user-function-interface = "0.0.0.0" user-function-interface = ${?HOST} diff --git a/java-support/src/main/scala/io/cloudstate/javasupport/impl/EntityDiscoveryImpl.scala b/java-support/src/main/scala/io/cloudstate/javasupport/impl/EntityDiscoveryImpl.scala index baa1831eb..7cf381e1f 100644 --- a/java-support/src/main/scala/io/cloudstate/javasupport/impl/EntityDiscoveryImpl.scala +++ b/java-support/src/main/scala/io/cloudstate/javasupport/impl/EntityDiscoveryImpl.scala @@ -25,11 +25,13 @@ import io.cloudstate.javasupport.{BuildInfo, StatefulService} class EntityDiscoveryImpl(system: ActorSystem, services: Map[String, StatefulService]) extends EntityDiscovery { + private val config = system.settings.config.getConfig("cloudstate") + private val serviceInfo = ServiceInfo( serviceRuntime = sys.props.getOrElse("java.runtime.name", "") + " " + sys.props.getOrElse("java.runtime.version", ""), - supportLibraryName = sys.env.getOrElse("SUPPORT_LIBRARY_NAME", BuildInfo.name), - supportLibraryVersion = sys.env.getOrElse("SUPPORT_LIBRARY_VERSION", BuildInfo.version) + supportLibraryName = config.getString("library.name"), + supportLibraryVersion = config.getString("library.version") ) /**