From d53f4601cfccd8dd574b1378b4ca72a0d172fe3f Mon Sep 17 00:00:00 2001 From: Thomas BOUSSELIN Date: Fri, 12 Jul 2024 14:30:25 +0200 Subject: [PATCH] fix: multiple mqtt as the same --- .../subscription/service/mqtt/MqttNotificationService.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subscription-service/src/main/kotlin/com/egm/stellio/subscription/service/mqtt/MqttNotificationService.kt b/subscription-service/src/main/kotlin/com/egm/stellio/subscription/service/mqtt/MqttNotificationService.kt index a5d9e07ce3..cab6195aaa 100644 --- a/subscription-service/src/main/kotlin/com/egm/stellio/subscription/service/mqtt/MqttNotificationService.kt +++ b/subscription-service/src/main/kotlin/com/egm/stellio/subscription/service/mqtt/MqttNotificationService.kt @@ -13,6 +13,7 @@ import org.eclipse.paho.mqttv5.client.MqttConnectionOptions import org.slf4j.LoggerFactory import org.springframework.beans.factory.annotation.Value import org.springframework.stereotype.Service +import java.util.* import org.eclipse.paho.client.mqttv3.MqttException as MqttExceptionV3 import org.eclipse.paho.mqttv5.common.MqttException as MqttExceptionV5 @@ -49,7 +50,7 @@ class MqttNotificationService( message = MqttNotificationData.MqttMessage(notification, headers), connection = MqttConnectionData( brokerUrl = brokerUrl, - clientId = clientId, + clientId = "${clientId}_${UUID.randomUUID()}", username = username, password = password )