From 17d727b31b221516ce95ba3096a7c43a5e0d9608 Mon Sep 17 00:00:00 2001 From: Stefan Witschel Date: Wed, 23 Oct 2024 09:56:33 +0200 Subject: [PATCH] Adding suffix to MQTT Service ClientId --- .../dynamic/mapping/connector/mqtt/MQTTServiceClient.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dynamic-mapping-service/src/main/java/dynamic/mapping/connector/mqtt/MQTTServiceClient.java b/dynamic-mapping-service/src/main/java/dynamic/mapping/connector/mqtt/MQTTServiceClient.java index 13c446c9..983f0841 100644 --- a/dynamic-mapping-service/src/main/java/dynamic/mapping/connector/mqtt/MQTTServiceClient.java +++ b/dynamic-mapping-service/src/main/java/dynamic/mapping/connector/mqtt/MQTTServiceClient.java @@ -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; @@ -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); }