public class MqttPahoMessageDrivenChannelAdapter extends AbstractMqttMessageDrivenChannelAdapter implements org.eclipse.paho.client.mqttv3.MqttCallback, org.springframework.context.ApplicationEventPublisherAware
topicLocklifecycleCondition, lifecycleLock| Constructor and Description |
|---|
MqttPahoMessageDrivenChannelAdapter(java.lang.String clientId,
MqttPahoClientFactory clientFactory,
java.lang.String... topic)
Use this constructor if the server URI(s) are provided by the
MqttConnectOptions.getServerURIs()
provided by the MqttPahoClientFactory. |
MqttPahoMessageDrivenChannelAdapter(java.lang.String url,
java.lang.String clientId,
MqttPahoClientFactory clientFactory,
java.lang.String... topic)
Use this constructor for a single url (although it may be overridden
if the server URI(s) are provided by the
MqttConnectOptions.getServerURIs()
provided by the MqttPahoClientFactory). |
MqttPahoMessageDrivenChannelAdapter(java.lang.String url,
java.lang.String clientId,
java.lang.String... topic)
Use this URL when you don't need additional
MqttConnectOptions. |
| Modifier and Type | Method and Description |
|---|---|
void |
addTopic(java.lang.String topic,
int qos)
Add a topic to the subscribed list.
|
void |
connectionLost(java.lang.Throwable cause) |
void |
deliveryComplete(org.eclipse.paho.client.mqttv3.IMqttDeliveryToken token) |
protected void |
doStart() |
protected void |
doStop() |
void |
messageArrived(java.lang.String topic,
org.eclipse.paho.client.mqttv3.MqttMessage mqttMessage) |
void |
removeTopic(java.lang.String... topic)
Remove a topic (or topics) from the subscribed list.
|
void |
setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher) |
void |
setCompletionTimeout(int completionTimeout)
Set the completion timeout for operations.
|
void |
setRecoveryInterval(int recoveryInterval)
The time (ms) to wait between reconnection attempts.
|
addTopic, addTopics, getClientId, getComponentType, getConverter, getQos, getTopic, getUrl, onInit, setConverter, setQosafterSingletonsInstantiated, buildErrorMessage, getErrorChannel, getErrorMessageAttributes, getMessagingTemplate, getOutputChannel, sendErrorMessageIfNecessary, sendMessage, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setOutputChannel, setOutputChannelName, setSendTimeout, setShouldTrackdestroy, doStop, getPhase, getRole, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, setTaskScheduler, start, stop, stopafterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, toStringpublic MqttPahoMessageDrivenChannelAdapter(java.lang.String url,
java.lang.String clientId,
MqttPahoClientFactory clientFactory,
java.lang.String... topic)
MqttConnectOptions.getServerURIs()
provided by the MqttPahoClientFactory).url - the URL.clientId - The client id.clientFactory - The client factory.topic - The topic(s).public MqttPahoMessageDrivenChannelAdapter(java.lang.String clientId,
MqttPahoClientFactory clientFactory,
java.lang.String... topic)
MqttConnectOptions.getServerURIs()
provided by the MqttPahoClientFactory.clientId - The client id.clientFactory - The client factory.topic - The topic(s).public MqttPahoMessageDrivenChannelAdapter(java.lang.String url,
java.lang.String clientId,
java.lang.String... topic)
MqttConnectOptions.url - The URL.clientId - The client id.topic - The topic(s).public void setCompletionTimeout(int completionTimeout)
completionTimeout - The timeout.public void setRecoveryInterval(int recoveryInterval)
recoveryInterval - the interval.public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
setApplicationEventPublisher in interface org.springframework.context.ApplicationEventPublisherAwareprotected void doStart()
doStart in class org.springframework.integration.endpoint.MessageProducerSupportprotected void doStop()
doStop in class org.springframework.integration.endpoint.MessageProducerSupportpublic void addTopic(java.lang.String topic,
int qos)
AbstractMqttMessageDrivenChannelAdapteraddTopic in class AbstractMqttMessageDrivenChannelAdaptertopic - The topic.qos - The qos.public void removeTopic(java.lang.String... topic)
AbstractMqttMessageDrivenChannelAdapterremoveTopic in class AbstractMqttMessageDrivenChannelAdaptertopic - The topic.public void connectionLost(java.lang.Throwable cause)
connectionLost in interface org.eclipse.paho.client.mqttv3.MqttCallbackpublic void messageArrived(java.lang.String topic,
org.eclipse.paho.client.mqttv3.MqttMessage mqttMessage)
throws java.lang.Exception
messageArrived in interface org.eclipse.paho.client.mqttv3.MqttCallbackjava.lang.Exceptionpublic void deliveryComplete(org.eclipse.paho.client.mqttv3.IMqttDeliveryToken token)
deliveryComplete in interface org.eclipse.paho.client.mqttv3.MqttCallback