public class MqttOptions extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
MqttOptions.Builder |
Constructor and Description |
---|
MqttOptions() |
Modifier and Type | Method and Description |
---|---|
long |
getConnectAttemptsMax() |
String |
getPassword() |
int |
getQos() |
long |
getReconnectAttemptsMax() |
double |
getReconnectBackOffMultiplier() |
long |
getReconnectDelay() |
long |
getReconnectDelayMax() |
List<String> |
getTopics() |
String |
getUrl() |
String |
getUserName() |
String |
getWillPayload() |
int |
getWillQos() |
boolean |
getWillRetain() |
String |
getWillTopic() |
boolean |
isCleanConnection() |
void |
setCleanConnection(boolean cleanConnection)
Set to false if you want the MQTT server to persist topic subscriptions and ack positions across client sessions.
|
void |
setConnectAttemptsMax(long connectAttemptsMax)
The maximum number of reconnect attempts before an error is reported back to the client on the first attempt by
the client to connect to a server.
|
void |
setPassword(String password)
The password for authenticated sessions.
|
void |
setQos(int qos)
Sets the quality of service to use for MQTT messages.
|
void |
setReconnectAttemptsMax(long reconnectAttemptsMax)
The maximum number of reconnect attempts before an error is reported back to the client after a server
connection had previously been established.
|
void |
setReconnectBackOffMultiplier(double reconnectBackOffMultiplier)
The Exponential backoff be used between reconnect attempts.
|
void |
setReconnectDelay(long reconnectDelay)
How long to wait in ms before the first reconnect attempt.
|
void |
setReconnectDelayMax(long reconnectDelayMax)
The maximum amount of time in ms to wait between reconnect attempts.
|
void |
setTopics(List<String> topics)
A list of MQTT topics to subscribe to.
|
void |
setUrl(String url)
Sets the url for connecting to the MQTT broker, e.g.
|
void |
setUserName(String userName)
The username for authenticated sessions.
|
void |
setWillPayload(String willPayload)
The Will message to send.
|
void |
setWillQos(int qos)
Sets the quality of service to use for the MQTT Will message.
|
void |
setWillRetain(boolean retain)
Set to true if you want the Will message to be published with the retain option.
|
void |
setWillTopic(String willTopic)
If set the server will publish the client's Will message to the specified topics if the client has an unexpected
disconnection.
|
public String getUrl()
public void setUrl(String url)
tcp://localhost:1883
.public boolean isCleanConnection()
public void setCleanConnection(boolean cleanConnection)
public String getWillTopic()
public void setWillTopic(String willTopic)
public String getWillPayload()
public void setWillPayload(String willPayload)
public long getReconnectDelay()
public void setReconnectDelay(long reconnectDelay)
public long getReconnectDelayMax()
public void setReconnectDelayMax(long reconnectDelayMax)
public double getReconnectBackOffMultiplier()
public void setReconnectBackOffMultiplier(double reconnectBackOffMultiplier)
public long getReconnectAttemptsMax()
public void setReconnectAttemptsMax(long reconnectAttemptsMax)
public long getConnectAttemptsMax()
public void setConnectAttemptsMax(long connectAttemptsMax)
public String getUserName()
public void setUserName(String userName)
public String getPassword()
public void setPassword(String password)
public int getQos()
public void setQos(int qos)
public int getWillQos()
public void setWillQos(int qos)
public boolean getWillRetain()
public void setWillRetain(boolean retain)
Copyright © 2023 The Apache Software Foundation. All rights reserved.