@ManagedResource @IntegrationManagedResource public abstract class AbstractMqttMessageDrivenChannelAdapter extends MessageProducerSupport
Modifier and Type | Field and Description |
---|---|
protected java.util.concurrent.locks.Lock |
topicLock |
lifecycleCondition, lifecycleLock
EXPRESSION_PARSER, logger
Constructor and Description |
---|
AbstractMqttMessageDrivenChannelAdapter(java.lang.String url,
java.lang.String clientId,
java.lang.String... topic) |
Modifier and Type | Method and Description |
---|---|
void |
addTopic(java.lang.String... topic)
Add a topic (or topics) to the subscribed list (qos=1).
|
void |
addTopic(java.lang.String topic,
int qos)
Add a topic to the subscribed list.
|
void |
addTopics(java.lang.String[] topic,
int[] qos)
Add topics to the subscribed list.
|
protected java.lang.String |
getClientId() |
java.lang.String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
protected MqttMessageConverter |
getConverter() |
int[] |
getQos() |
java.lang.String[] |
getTopic() |
protected java.lang.String |
getUrl() |
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
void |
removeTopic(java.lang.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, getMessagingTemplate, getOutputChannel, sendErrorMessageIfNecessary, sendMessage, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setOutputChannel, setOutputChannelName, setSendTimeout, setShouldTrack
destroy, doStop, getPhase, getRole, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, setTaskScheduler, start, stop, stop
afterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getComponentName
public AbstractMqttMessageDrivenChannelAdapter(java.lang.String url, java.lang.String clientId, java.lang.String... topic)
public void setConverter(MqttMessageConverter converter)
public void setQos(int... qos)
qos
- The qos value(s).@ManagedAttribute public int[] getQos()
protected java.lang.String getUrl()
protected java.lang.String getClientId()
protected MqttMessageConverter getConverter()
@ManagedAttribute public java.lang.String[] getTopic()
public java.lang.String getComponentType()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class IntegrationObjectSupport
@ManagedOperation public void addTopic(java.lang.String topic, int qos)
topic
- The topic.qos
- The qos.org.springframework.messaging.MessagingException
- if the topic is already in the list.@ManagedOperation public void addTopic(java.lang.String... topic)
topic
- The topics.org.springframework.messaging.MessagingException
- if the topic is already in the list.@ManagedOperation public void addTopics(java.lang.String[] topic, int[] qos)
topic
- The topics.qos
- The qos for each topic.org.springframework.messaging.MessagingException
- if a topic is already in the list.@ManagedOperation public void removeTopic(java.lang.String... topic)
topic
- The topic.org.springframework.messaging.MessagingException
- if the topic is not in the list.protected void onInit()
IntegrationObjectSupport
onInit
in class MessageProducerSupport