Skip to content
This repository has been archived by the owner on Mar 16, 2022. It is now read-only.

Commit

Permalink
Allow java-support service info to be overridden in config (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
pvlugter authored and Heiko Seeberger committed May 4, 2020
1 parent b656e30 commit 89a8708
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
8 changes: 1 addition & 7 deletions java-support/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
@@ -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}

Expand All @@ -31,4 +25,4 @@ cloudstate {
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)

/**
Expand Down

0 comments on commit 89a8708

Please sign in to comment.