added boolean param to the mqtt node to allow adding a suffix for client id param
This commit is contained in:
parent
3950b58845
commit
9c44530ab9
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user