Browse Source
Merge pull request #5762 from dmytro-landiak/mqtt-node
[3.3.3] Mqtt rule node update
pull/5872/head
Igor Kulikov
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
3 additions and
1 deletions
-
rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/mqtt/TbMqttNode.java
-
rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/mqtt/TbMqttNodeConfiguration.java
|
|
|
@ -104,7 +104,8 @@ public class TbMqttNode implements TbNode { |
|
|
|
protected MqttClient initClient(TbContext ctx) throws Exception { |
|
|
|
MqttClientConfig config = new MqttClientConfig(getSslContext()); |
|
|
|
if (!StringUtils.isEmpty(this.mqttNodeConfiguration.getClientId())) { |
|
|
|
config.setClientId(this.mqttNodeConfiguration.getClientId()); |
|
|
|
config.setClientId(this.mqttNodeConfiguration.isAppendClientIdSuffix() ? |
|
|
|
this.mqttNodeConfiguration.getClientId() + "_" + ctx.getServiceId() : this.mqttNodeConfiguration.getClientId()); |
|
|
|
} |
|
|
|
config.setCleanSession(this.mqttNodeConfiguration.isCleanSession()); |
|
|
|
|
|
|
|
|
|
|
|
@ -28,6 +28,7 @@ public class TbMqttNodeConfiguration implements NodeConfiguration<TbMqttNodeConf |
|
|
|
private int port; |
|
|
|
private int connectTimeoutSec; |
|
|
|
private String clientId; |
|
|
|
private boolean appendClientIdSuffix; |
|
|
|
|
|
|
|
private boolean cleanSession; |
|
|
|
private boolean ssl; |
|
|
|
|