Add clean session flag to MQTT Node configuration.
This commit is contained in:
parent
9f82e59b2d
commit
6e78f33730
@ -111,6 +111,7 @@ public class TbMqttNode implements TbNode {
|
||||
if (!StringUtils.isEmpty(this.config.getClientId())) {
|
||||
config.setClientId(this.config.getClientId());
|
||||
}
|
||||
config.setCleanSession(this.config.isCleanSession());
|
||||
this.config.getCredentials().configure(config);
|
||||
MqttClient client = MqttClient.create(config);
|
||||
client.setEventLoop(this.eventLoopGroup);
|
||||
|
||||
@ -30,6 +30,7 @@ public class TbMqttNodeConfiguration implements NodeConfiguration<TbMqttNodeConf
|
||||
private int connectTimeoutSec;
|
||||
private String clientId;
|
||||
|
||||
private boolean cleanSession;
|
||||
private boolean ssl;
|
||||
private MqttClientCredentials credentials;
|
||||
|
||||
@ -40,6 +41,7 @@ public class TbMqttNodeConfiguration implements NodeConfiguration<TbMqttNodeConf
|
||||
configuration.setHost("localhost");
|
||||
configuration.setPort(1883);
|
||||
configuration.setConnectTimeoutSec(10);
|
||||
configuration.setCleanSession(true);
|
||||
configuration.setSsl(false);
|
||||
configuration.setCredentials(new AnonymousCredentials());
|
||||
return configuration;
|
||||
|
||||
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user