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

Allow java-support service info to be overridden in config #294

Merged
merged 1 commit into from
May 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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