public abstract class AbstractMqttMessageHandler extends AbstractMessageHandler implements Lifecycle
IntegrationManagement.ManagementOverridesEXPRESSION_PARSER, loggerMETER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE| Constructor and Description |
|---|
AbstractMqttMessageHandler(String url,
String clientId) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
doStart() |
protected abstract void |
doStop() |
String |
getClientId() |
int |
getClientInstance()
Incremented each time the client is connected.
|
String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
protected MessageConverter |
getConverter() |
protected String |
getUrl() |
protected void |
handleMessageInternal(Message<?> message) |
protected void |
incrementClientInstance() |
boolean |
isRunning() |
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
protected abstract void |
publish(String topic,
Object mqttMessage,
Message<?> message) |
void |
setConverter(MessageConverter converter)
Set the message converter to use; if this is provided, the adapter qos and retained
settings are ignored.
|
void |
setDefaultQos(int defaultQos)
Set the qos for messages if the
qosExpression
evaluates to null. |
void |
setDefaultRetained(boolean defaultRetained)
Set the retained boolean for messages if the
retainedExpression evaluates to null. |
void |
setDefaultTopic(String defaultTopic)
Set the topic to which the message will be published if the
topicExpression evaluates to `null`. |
void |
setQosExpression(Expression qosExpression)
Set the qos expression; default "headers['mqtt_qos']".
|
void |
setQosExpressionString(String qosExpression)
Set the qos expression; default "headers['mqtt_qos']".
|
void |
setRetainedExpression(Expression retainedExpression)
Set the retained expression; default "headers['mqtt_retained']".
|
void |
setRetainedExpressionString(String retainedExpression)
Set the retained expression; default "headers['mqtt_retained']".
|
void |
setTopicExpression(Expression topicExpression)
Set the topic expression; default "headers['mqtt_topic']".
|
void |
setTopicExpressionString(String topicExpression)
Set the topic expression; default "headers['mqtt_topic']".
|
void |
start() |
void |
stop() |
configureMetrics, destroy, getActiveCount, getActiveCountLong, getDuration, getErrorCount, getErrorCountLong, getHandleCount, getHandleCountLong, getManagedName, getManagedType, getMaxDuration, getMeanDuration, getMinDuration, getOrder, getOverrides, getStandardDeviationDuration, handleMessage, isCountsEnabled, isLoggingEnabled, isStatsEnabled, onComplete, onError, onNext, onSubscribe, registerMetricsCaptor, reset, setCountsEnabled, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, setStatsEnabledafterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waiterrorCount, handleCountgetBeanName, getComponentNamepublic void setDefaultTopic(String defaultTopic)
topicExpression evaluates to `null`.defaultTopic - the default topic.public void setTopicExpression(Expression topicExpression)
topicExpression - the expression.public void setTopicExpressionString(String topicExpression)
topicExpression - the expression.public void setDefaultQos(int defaultQos)
qosExpression
evaluates to null. Only applies if a message converter is not provided.defaultQos - the default qos.setConverter(MessageConverter)public void setQosExpression(Expression qosExpression)
qosExpression - the expression.setConverter(MessageConverter)public void setQosExpressionString(String qosExpression)
qosExpression - the expression.setConverter(MessageConverter)public void setDefaultRetained(boolean defaultRetained)
retainedExpression evaluates to null.
Only applies if a message converter is not provided.defaultRetained - the default defaultRetained.setConverter(MessageConverter)public void setRetainedExpression(Expression retainedExpression)
retainedExpression - the expression.setConverter(MessageConverter)public void setRetainedExpressionString(String retainedExpression)
retainedExpression - the expression.setConverter(MessageConverter)public void setConverter(MessageConverter converter)
converter - the converter.protected MessageConverter getConverter()
protected String getUrl()
public String getClientId()
public int getClientInstance()
public String getComponentType()
IntegrationObjectSupportgetComponentType in interface NamedComponentgetComponentType in class AbstractMessageHandlerprotected void incrementClientInstance()
protected void onInit()
IntegrationObjectSupportonInit in class AbstractMessageHandlerprotected abstract void doStart()
protected abstract void doStop()
protected void handleMessageInternal(Message<?> message)
handleMessageInternal in class AbstractMessageHandler