diff --git a/java-support/src/main/resources/reference.conf b/java-support/src/main/resources/reference.conf index 41d409dce..2b02ca0a2 100644 --- a/java-support/src/main/resources/reference.conf +++ b/java-support/src/main/resources/reference.conf @@ -1,10 +1,4 @@ cloudstate { - - library { - name = "cloudstate-java-support" - version = "0.4.3" - } - user-function-interface = "127.0.0.1" user-function-interface = ${?HOST} @@ -31,4 +25,4 @@ cloudstate { } } } -} \ No newline at end of file +} 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 7cf381e1f..a5b84c739 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,13 +25,14 @@ 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 def configuredOrElse(key: String, default: String): String = + if (system.settings.config.hasPath(key)) system.settings.config.getString(key) else default private val serviceInfo = ServiceInfo( - serviceRuntime = sys.props.getOrElse("java.runtime.name", "") + " " + sys.props.getOrElse("java.runtime.version", - ""), - supportLibraryName = config.getString("library.name"), - supportLibraryVersion = config.getString("library.version") + serviceRuntime = sys.props.getOrElse("java.runtime.name", "") + + " " + sys.props.getOrElse("java.runtime.version", ""), + supportLibraryName = configuredOrElse("cloudstate.library.name", BuildInfo.name), + supportLibraryVersion = configuredOrElse("cloudstate.library.version", BuildInfo.version) ) /**