@ManagedResource @IntegrationManagedResource public abstract class AbstractMqttMessageDrivenChannelAdapter extends MessageProducerSupport
Modifier and Type | Field and Description |
---|---|
protected Lock |
topicLock |
lifecycleCondition, lifecycleLock
EXPRESSION_PARSER, logger
DEFAULT_PHASE
Constructor and Description |
---|
AbstractMqttMessageDrivenChannelAdapter(String url,
String clientId,
String... topic) |
Modifier and Type | Method and Description |
---|---|
void |
addTopic(String... topic)
Add a topic (or topics) to the subscribed list (qos=1).
|
void |
addTopic(String topic,
int qos)
Add a topic to the subscribed list.
|
void |
addTopics(String[] topic,
int[] qos)
Add topics to the subscribed list.
|
protected String |
getClientId() |
String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
protected MqttMessageConverter |
getConverter() |
int[] |
getQos() |
String[] |
getTopic() |
protected String |
getUrl() |
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
void |
removeTopic(String... topic)
Remove a topic (or topics) from the subscribed list.
|
void |
setConverter(MqttMessageConverter converter) |
void |
setQos(int... qos)
Set the QoS for each topic; a single value will apply to all topics otherwise
the correct number of qos values must be provided.
|
afterSingletonsInstantiated, buildErrorMessage, doStart, doStop, getErrorChannel, getErrorMessageAttributes, getIntegrationPatternType, getMessagingTemplate, getOutputChannel, sendErrorMessageIfNecessary, sendMessage, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setOutputChannel, setOutputChannelName, setSendTimeout, setShouldTrack, subscribeToPublisher
destroy, doStop, getPhase, getRole, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stop
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getBeanName, getComponentName
protected final Lock topicLock
public void setConverter(MqttMessageConverter converter)
public void setQos(int... qos)
qos
- The qos value(s).@ManagedAttribute public int[] getQos()
protected String getClientId()
protected MqttMessageConverter getConverter()
@ManagedAttribute public String[] getTopic()
public String getComponentType()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class IntegrationObjectSupport
@ManagedOperation public void addTopic(String topic, int qos)
topic
- The topic.qos
- The qos.MessagingException
- if the topic is already in the list.@ManagedOperation public void addTopic(String... topic)
topic
- The topics.MessagingException
- if the topic is already in the list.@ManagedOperation public void addTopics(String[] topic, int[] qos)
topic
- The topics.qos
- The qos for each topic.MessagingException
- if a topic is already in the list.@ManagedOperation public void removeTopic(String... topic)
topic
- The topic.MessagingException
- if the topic is not in the list.protected void onInit()
IntegrationObjectSupport
onInit
in class MessageProducerSupport