Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Puck Wang committed Oct 11, 2023
1 parent 8699fe0 commit 48290c2
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public HeartbeatGenerator(SolaceConfiguration solaceConfiguration,
this.solacePublisher = solacePublisher;
this.runtimeAgentId = eventPortalProperties.getRuntimeAgentId();
topic = solaceConfiguration.getTopicPrefix() + "heartbeat/v1";
this.runtimeAgentVersion = buildProperties.getVersion().substring(0, buildProperties.getVersion().indexOf('-'));
this.runtimeAgentVersion = getFormattedVersion(buildProperties.getVersion());
}

@Scheduled(fixedRate = 5000)
Expand All @@ -38,4 +38,10 @@ public void sendHeartbeat() {
solacePublisher.publish(message, topic);
}

private String getFormattedVersion(String version) {
if (version.endsWith("-SNAPSHOT")) {
return version.replace("-SNAPSHOT", "");
}
return version;
}
}

0 comments on commit 48290c2

Please sign in to comment.