public class MqttPahoMessageDrivenChannelAdapter extends AbstractMqttMessageDrivenChannelAdapter implements org.eclipse.paho.client.mqttv3.MqttCallback, org.springframework.context.ApplicationEventPublisherAware
| Modifier and Type | Field and Description |
|---|---|
static long |
DEFAULT_COMPLETION_TIMEOUT |
topicLocklifecycleCondition, lifecycleLockEXPRESSION_PARSER, logger| 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()
Takes no action by default.
|
protected void |
doStop()
Takes no action by default.
|
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(long 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, generateId, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetComponentNamepublic static final long DEFAULT_COMPLETION_TIMEOUT
public 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(long 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()
MessageProducerSupportdoStart in class MessageProducerSupportprotected void doStop()
MessageProducerSupportdoStop in class 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)
messageArrived in interface org.eclipse.paho.client.mqttv3.MqttCallbackpublic void deliveryComplete(org.eclipse.paho.client.mqttv3.IMqttDeliveryToken token)
deliveryComplete in interface org.eclipse.paho.client.mqttv3.MqttCallback