Class MqttConfiguration
java.lang.Object
org.chenile.configuration.mqtt.MqttConfiguration
Sets up Eclipse Paho for communicating with MQ-TT broker using configurations
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int(package private) StringThis is the base publish topic that will be pre-pended to publish messages.private StringThis is the base topic name that will pre-pended for all subscriptions.private Stringprivate String(package private) org.slf4j.Loggerprivate booleanprivate Longprivate Stringprivate intprivate booleanprivate String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis converts a string to a byte array.(package private) org.eclipse.paho.mqttv5.client.DisconnectedBufferOptions(package private) org.eclipse.paho.mqttv5.client.persist.MemoryPersistence(package private) org.eclipse.paho.mqttv5.client.MqttConnectionOptions(package private) MqttPublisher(package private) MqttSubscribermqttSubscriber(org.eclipse.paho.mqttv5.client.MqttAsyncClient v5Client) (package private) org.eclipse.paho.mqttv5.client.MqttAsyncClientmqttV5Client(Map<String, String> mqttConnectionDetails, org.eclipse.paho.mqttv5.client.MqttConnectionOptions connOpts, org.eclipse.paho.mqttv5.client.persist.MemoryPersistence persistence, org.eclipse.paho.mqttv5.client.DisconnectedBufferOptions disconnectedBufferOptions) wildCardsTopic(org.eclipse.paho.mqttv5.client.MqttAsyncClient v5Client) (package private) org.eclipse.paho.mqttv5.common.MqttMessagewillMessage(org.eclipse.paho.mqttv5.client.MqttConnectionOptions options)
-
Field Details
-
logger
org.slf4j.Logger logger -
hostURI
-
basePublishTopic
This is the base publish topic that will be pre-pended to publish messages. This can contain specific expressions such as {tenantId} for example which will be substituted by the actual tenantId at the time of publishing a message. This value may not be the same as the base subscribe topic because publishing happens at runtime while subscription happens during startup. Hence, subscription can contain wild cards (such as +) whereas publishing may include expressions that will be substituted from the headers (such as tenant Id etc.) But if it is a constant expression they both can be the same. (default: chenile) -
baseSubscribeTopic
-
willPayload
-
willQos
-
willRetained
-
willTopic
-
clientID
-
actionTimeout
-
mqttEnabled
-
sessionExpiry
-
-
Constructor Details
-
MqttConfiguration
public MqttConfiguration()
-
-
Method Details
-
mqttConnectionDetails
-
convertStringToBytes
-
mqttConnectionOpts
@Bean @ConfigurationProperties(prefix="mqtt.connection") org.eclipse.paho.mqttv5.client.MqttConnectionOptions mqttConnectionOpts() -
willMessage
@Bean org.eclipse.paho.mqttv5.common.MqttMessage willMessage(@Autowired org.eclipse.paho.mqttv5.client.MqttConnectionOptions options) -
memoryPersistence
-
disconnectedBufferOptions
@Bean @ConfigurationProperties(prefix="pubsub.mqtt.disconnected.buffer") org.eclipse.paho.mqttv5.client.DisconnectedBufferOptions disconnectedBufferOptions() -
mqttV5Client
@Bean org.eclipse.paho.mqttv5.client.MqttAsyncClient mqttV5Client(@Autowired @Qualifier("mqttConnectionDetails") Map<String, String> mqttConnectionDetails, @Autowired org.eclipse.paho.mqttv5.client.MqttConnectionOptions connOpts, @Autowired org.eclipse.paho.mqttv5.client.persist.MemoryPersistence persistence, @Autowired org.eclipse.paho.mqttv5.client.DisconnectedBufferOptions disconnectedBufferOptions) throws org.eclipse.paho.mqttv5.common.MqttException- Throws:
org.eclipse.paho.mqttv5.common.MqttException
-
mqttSubscriber
@Bean MqttSubscriber mqttSubscriber(@Autowired org.eclipse.paho.mqttv5.client.MqttAsyncClient v5Client) -
mqttPublisher
-
wildCardsTopic
@Bean public WildCardsTopic wildCardsTopic(@Autowired org.eclipse.paho.mqttv5.client.MqttAsyncClient v5Client)
-