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

Settings ServiceInfo in order to enable the reuse of java-support in other JVM languages #192

Merged
merged 6 commits into from
Mar 1, 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
4 changes: 2 additions & 2 deletions docs/src/main/paradox/user/lang/java/gettingstarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ In addition to the above, you will need to install the Cloudstate java support l
Maven
: @@@vars
```xml
<depependency>
<dependency>
<groupId>io.cloudstate</groupId>
<artifactId>cloudstate-java-support</artifactId>
<version>$cloudstate.java-support.version$</version>
</depependency>
</dependency>
```
@@@

Expand Down
6 changes: 6 additions & 0 deletions java-support/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
@@ -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}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = BuildInfo.name,
supportLibraryVersion = BuildInfo.version
supportLibraryName = config.getString("library.name"),
supportLibraryVersion = config.getString("library.version")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it matter that this no longer uses the automatically generated current version for cloudstate-java-support, but is instead fixed in config?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pvlugter This exists for another support idiom library (like Kotlin) that uses lib java-support as a base and defines a hocon file reference.conf or application.conf and can overwrite the version of the java library with its own information.

Copy link
Member

@pvlugter pvlugter May 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, understand the usage. But currently published versions of cloudstate-java-support, like 0.4.7, will report their version as 0.4.3 since it's hardcoded in the config. What we want is for the name and version to be overridable in config, but use the generated build info by default. I'll make an update for this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in #294

)
sleipnir marked this conversation as resolved.
Show resolved Hide resolved

/**
Expand Down