@ManagedResource
public abstract class AbstractMqttMessageDrivenChannelAdapter
extends org.springframework.integration.endpoint.MessageProducerSupport
Modifier and Type | Field and Description |
---|---|
protected java.util.concurrent.locks.Lock |
topicLock |
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() |
protected MqttMessageConverter |
getConverter() |
int[] |
getQos() |
java.lang.String[] |
getTopic() |
protected java.lang.String |
getUrl() |
protected void |
onInit() |
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.
|
doStart, doStop, sendMessage, setErrorChannel, setOutputChannel, setSendTimeout, setShouldTrack
doStop, getPhase, isAutoStartup, isRunning, setAutoStartup, setPhase, setTaskScheduler, start, stop, stop
afterPropertiesSet, getApplicationContext, getApplicationContextId, getBeanFactory, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setConversionService, setMessageBuilderFactory, toString
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()
getComponentType
in interface org.springframework.integration.support.context.NamedComponent
getComponentType
in class org.springframework.integration.context.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()
onInit
in class org.springframework.integration.endpoint.MessageProducerSupport