Skip to content

Commit

Permalink
Adding suffix to MQTT Service ClientId
Browse files Browse the repository at this point in the history
  • Loading branch information
switschel committed Oct 23, 2024
1 parent 5eb1318 commit 17d727b
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ public MQTTServiceClient() {
private static String nextId() {
return "CUMULOCITY_MQTT_SERVICE" + Integer.toString(random.nextInt(Integer.MAX_VALUE - 100000) + 100000, 36);
}
private static String getClientId(String ident) {
return "CUMULOCITY_MQTT_SERVICE" + ident;
private static String getClientId(String ident, String suffix) {
return "CUMULOCITY_MQTT_SERVICE" + ident + suffix;
}
// return random.nextInt(max - min) + min;

Expand Down Expand Up @@ -115,7 +115,7 @@ public MQTTServiceClient(ConfigurationRegistry configurationRegistry,
new ConnectorProperty(true, 3, ConnectorPropertyType.SENSITIVE_STRING_PROPERTY, true, true,
msc.getPassword(), null));
getConnectorSpecification().getProperties().put("clientId", new ConnectorProperty(true, 5, ConnectorPropertyType.ID_STRING_PROPERTY, true, true,
getClientId(this.connectorIdent), null));
getClientId(this.connectorIdent, this.additionalSubscriptionIdTest), null));
this.supportedQOS = Arrays.asList(QOS.AT_LEAST_ONCE, QOS.AT_MOST_ONCE);
}

Expand Down

0 comments on commit 17d727b

Please sign in to comment.