Class MqttClientCreator
java.lang.Object
org.dromara.mica.mqtt.core.client.MqttClientCreator
mqtt 客户端构造器
- Author:
- L.cm
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbizThreadPoolSize(int poolSize) bufferAllocator(org.tio.utils.buffer.ByteBufferAllocator allocator) cleanSession(boolean cleanSession) clientSession(IMqttClientSession clientSession) connect()默认异步连接connectListener(IMqttClientConnectListener connectListener) 同步连接org.dromara.mica.mqtt.codec.MqttConnectReasonCode连接测试org.dromara.mica.mqtt.codec.MqttConnectReasonCodeconnectTest(long timeout, TimeUnit timeUnit) 连接测试debug()org.tio.utils.buffer.ByteBufferAllocatorSet<org.dromara.mica.mqtt.codec.MqttTopicSubscription>org.tio.core.task.HeartbeatModeorg.tio.client.task.HeartbeatTimeoutStrategygetIp()intintintgetName()intgetPort()org.dromara.mica.mqtt.codec.MqttPropertiesintlongintintorg.tio.core.ssl.SslConfigorg.tio.utils.timer.TimerTaskServiceorg.tio.utils.thread.pool.SynThreadPoolExecutororg.dromara.mica.mqtt.codec.MqttVersionglobalMessageListener(IMqttClientGlobalMessageListener globalMessageListener) globalSubscribe(String... topics) globalSubscribe(List<org.dromara.mica.mqtt.codec.MqttTopicSubscription> topicList) globalSubscribe(org.dromara.mica.mqtt.codec.MqttTopicSubscription... topics) groupExecutor(ExecutorService groupExecutor) heartbeatMode(org.tio.core.task.HeartbeatMode heartbeatMode) heartbeatTimeoutStrategy(org.tio.client.task.HeartbeatTimeoutStrategy heartbeatTimeoutStrategy) booleanbooleanisDebug()booleanbooleankeepAliveSecs(int keepAliveSecs) maxBytesInMessage(int maxBytesInMessage) maxClientIdLength(int maxClientIdLength) messageIdGenerator(IMqttClientMessageIdGenerator messageIdGenerator) mqttExecutor(ExecutorService mqttExecutor) port(int port) properties(org.dromara.mica.mqtt.codec.MqttProperties properties) readBufferSize(int readBufferSize) reconnect(boolean reconnect) reInterval(long reInterval) reSubscribeBatchSize(int reSubscribeBatchSize) retryCount(int retryCount) sessionExpiryIntervalSecs(Integer sessionExpiryIntervalSecs) sslConfig(org.tio.core.ssl.SslConfig sslConfig) statEnable(boolean enable) taskService(org.tio.utils.timer.TimerTaskService taskService) timeout(int timeout) tioConfigCustomize(Consumer<org.tio.core.TioConfig> tioConfigCustomize) tioExecutor(org.tio.utils.thread.pool.SynThreadPoolExecutor tioExecutor) useSsl()useSsl(InputStream trustStoreInputStream, String trustPassword) useSsl(InputStream keyStoreInputStream, String keyPasswd, InputStream trustStoreInputStream, String trustPassword) version(org.dromara.mica.mqtt.codec.MqttVersion version) willMessage(Consumer<MqttWillMessage.Builder> consumer) willMessage(MqttWillMessage willMessage)
-
Field Details
-
DEFAULT_KEEP_ALIVE_SECS
public static final int DEFAULT_KEEP_ALIVE_SECS默认的心跳超时- See Also:
-
-
Constructor Details
-
MqttClientCreator
public MqttClientCreator()
-
-
Method Details
-
getName
-
getIp
-
getPort
public int getPort() -
getTimeout
-
getReadBufferSize
public int getReadBufferSize() -
getMaxBytesInMessage
public int getMaxBytesInMessage() -
getMaxClientIdLength
public int getMaxClientIdLength() -
getKeepAliveSecs
public int getKeepAliveSecs() -
getHeartbeatMode
public org.tio.core.task.HeartbeatMode getHeartbeatMode() -
getHeartbeatTimeoutStrategy
public org.tio.client.task.HeartbeatTimeoutStrategy getHeartbeatTimeoutStrategy() -
getSslConfig
public org.tio.core.ssl.SslConfig getSslConfig() -
isReconnect
public boolean isReconnect() -
getRetryCount
public int getRetryCount() -
getReInterval
public long getReInterval() -
getReSubscribeBatchSize
public int getReSubscribeBatchSize() -
getClientId
-
getVersion
public org.dromara.mica.mqtt.codec.MqttVersion getVersion() -
getUsername
-
getPassword
-
isCleanSession
public boolean isCleanSession() -
getSessionExpiryIntervalSecs
-
getWillMessage
-
getProperties
public org.dromara.mica.mqtt.codec.MqttProperties getProperties() -
getBufferAllocator
public org.tio.utils.buffer.ByteBufferAllocator getBufferAllocator() -
getConnectListener
-
getGlobalSubscribe
-
getGlobalMessageListener
-
getClientSession
-
getMessageIdGenerator
-
isStatEnable
public boolean isStatEnable() -
isDebug
public boolean isDebug() -
getTioExecutor
public org.tio.utils.thread.pool.SynThreadPoolExecutor getTioExecutor() -
getGroupExecutor
-
getMqttExecutor
-
getTaskService
public org.tio.utils.timer.TimerTaskService getTaskService() -
name
-
ip
-
port
-
timeout
-
readBufferSize
-
maxBytesInMessage
-
maxClientIdLength
-
keepAliveSecs
-
heartbeatMode
-
heartbeatTimeoutStrategy
public MqttClientCreator heartbeatTimeoutStrategy(org.tio.client.task.HeartbeatTimeoutStrategy heartbeatTimeoutStrategy) -
useSsl
-
useSsl
-
useSsl
public MqttClientCreator useSsl(String keyStoreFile, String keyPasswd, String trustStoreFile, String trustPassword) -
useSsl
-
useSsl
public MqttClientCreator useSsl(InputStream keyStoreInputStream, String keyPasswd, InputStream trustStoreInputStream, String trustPassword) -
sslConfig
-
reconnect
-
retryCount
-
reInterval
-
reSubscribeBatchSize
-
clientId
-
version
-
username
-
password
-
cleanSession
-
sessionExpiryIntervalSecs
-
willMessage
-
willMessage
-
properties
-
bufferAllocator
-
connectListener
-
globalSubscribe
-
globalSubscribe
public MqttClientCreator globalSubscribe(org.dromara.mica.mqtt.codec.MqttTopicSubscription... topics) -
globalSubscribe
public MqttClientCreator globalSubscribe(List<org.dromara.mica.mqtt.codec.MqttTopicSubscription> topicList) -
globalMessageListener
public MqttClientCreator globalMessageListener(IMqttClientGlobalMessageListener globalMessageListener) -
clientSession
-
messageIdGenerator
-
statEnable
-
statEnable
-
debug
-
tioExecutor
-
groupExecutor
-
mqttExecutor
-
bizThreadPoolSize
-
taskService
-
tioConfigCustomize
-
connect
默认异步连接- Returns:
- TioClient
-
connectSync
同步连接- Returns:
- TioClient
-
connectTest
public org.dromara.mica.mqtt.codec.MqttConnectReasonCode connectTest()连接测试- Returns:
- MqttConnectReasonCode
-
connectTest
public org.dromara.mica.mqtt.codec.MqttConnectReasonCode connectTest(long timeout, TimeUnit timeUnit) 连接测试- Parameters:
timeout- timeouttimeUnit- TimeUnit- Returns:
- MqttConnectReasonCode
-