Class MqttPahoMessageHandler
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.MessageHandlerSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.mqtt.outbound.AbstractMqttMessageHandler<org.eclipse.paho.client.mqttv3.IMqttAsyncClient,org.eclipse.paho.client.mqttv3.MqttConnectOptions>
org.springframework.integration.mqtt.outbound.MqttPahoMessageHandler
- All Implemented Interfaces:
org.eclipse.paho.client.mqttv3.MqttCallback,org.reactivestreams.Subscriber<Message<?>>,Aware,BeanFactoryAware,BeanNameAware,DisposableBean,InitializingBean,ApplicationContextAware,ApplicationEventPublisherAware,Lifecycle,Ordered,ComponentSourceAware,ExpressionCapable,Orderable,IntegrationPattern,MqttComponent<org.eclipse.paho.client.mqttv3.MqttConnectOptions>,MqttPahoComponent,NamedComponent,IntegrationManagement,ManageableLifecycle,TrackableComponent,MessageHandler,reactor.core.CoreSubscriber<Message<?>>
@Deprecated(since="7.2",
forRemoval=true)
public class MqttPahoMessageHandler
extends AbstractMqttMessageHandler<org.eclipse.paho.client.mqttv3.IMqttAsyncClient,org.eclipse.paho.client.mqttv3.MqttConnectOptions>
implements org.eclipse.paho.client.mqttv3.MqttCallback, MqttPahoComponent
Deprecated, for removal: This API element is subject to removal in a future version.
Eclipse Paho Implementation. When consuming
MqttIntegrationEvents
published by this component use MqttPahoComponent handler = event.getSourceAsType() to get a
reference, allowing you to obtain the bean name and MqttConnectOptions. This
technique allows consumption of events from both inbound and outbound endpoints in the
same event listener.- Since:
- 4.0
- Author:
- Gary Russell, Artem Bilan, Artem Vozhdayenko, Christian Tzolov, Jaehong Park
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagement
IntegrationManagement.ManagementOverrides -
Field Summary
Fields inherited from class org.springframework.integration.mqtt.outbound.AbstractMqttMessageHandler
DEFAULT_COMPLETION_TIMEOUT, DISCONNECT_COMPLETION_TIMEOUT, lockFields inherited from class org.springframework.integration.context.IntegrationObjectSupport
EXPRESSION_PARSER, loggerFields inherited from interface org.springframework.integration.support.management.IntegrationManagement
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionMqttPahoMessageHandler(String url, String clientId) Deprecated, for removal: This API element is subject to removal in a future version.Use this constructor when you don't need additionalMqttConnectOptions.MqttPahoMessageHandler(String url, String clientId, MqttPahoClientFactory clientFactory) Deprecated, for removal: This API element is subject to removal in a future version.Use this constructor for a single url (although it may be overridden if the server URI(s) are provided by theMqttConnectOptions.getServerURIs()provided by theMqttPahoClientFactory).MqttPahoMessageHandler(String clientId, MqttPahoClientFactory clientFactory) Deprecated, for removal: This API element is subject to removal in a future version.Use this constructor if the server URI(s) are provided by theMqttConnectOptions.getServerURIs()provided by theMqttPahoClientFactory.MqttPahoMessageHandler(ClientManager<org.eclipse.paho.client.mqttv3.IMqttAsyncClient, org.eclipse.paho.client.mqttv3.MqttConnectOptions> clientManager) Deprecated, for removal: This API element is subject to removal in a future version.Use this constructor when you need to use a singleClientManager(for instance, to reuse an MQTT connection). -
Method Summary
Modifier and TypeMethodDescriptionvoidconnectionLost(Throwable cause) Deprecated, for removal: This API element is subject to removal in a future version.voiddeliveryComplete(org.eclipse.paho.client.mqttv3.IMqttDeliveryToken token) Deprecated, for removal: This API element is subject to removal in a future version.protected voiddoStart()Deprecated, for removal: This API element is subject to removal in a future version.protected voiddoStop()Deprecated, for removal: This API element is subject to removal in a future version.org.eclipse.paho.client.mqttv3.MqttConnectOptionsDeprecated, for removal: This API element is subject to removal in a future version.Return information about the connection.voidmessageArrived(String topic, org.eclipse.paho.client.mqttv3.MqttMessage message) Deprecated, for removal: This API element is subject to removal in a future version.protected voidonInit()Deprecated, for removal: This API element is subject to removal in a future version.Subclasses may implement this for initialization logic.protected voidDeprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class org.springframework.integration.mqtt.outbound.AbstractMqttMessageHandler
getApplicationEventPublisher, getClientId, getClientInstance, getClientManager, getCompletionTimeout, getComponentType, getConverter, getDefaultQos, getDefaultRetained, getDefaultTopic, getDisconnectCompletionTimeout, getQosProcessor, getRetainedProcessor, getTopicProcessor, getUrl, handleMessageInternal, incrementClientInstance, isAsync, isRunning, messageSentEvent, sendDeliveryCompleteEvent, sendFailedDeliveryEvent, setApplicationEventPublisher, setAsync, setAsyncEvents, setCompletionTimeout, setConverter, setDefaultQos, setDefaultRetained, setDefaultTopic, setDisconnectCompletionTimeout, setQosExpression, setQosExpressionString, setRetainedExpression, setRetainedExpressionString, setTopicExpression, setTopicExpressionString, start, stopMethods inherited from class org.springframework.integration.handler.AbstractMessageHandler
handleMessage, onComplete, onError, onNext, onSubscribe, setObservationConventionMethods inherited from class org.springframework.integration.handler.MessageHandlerSupport
buildSendTimer, destroy, getIntegrationPatternType, getManagedName, getManagedType, getMetricsCaptor, getObservationRegistry, getOrder, getOverrides, isLoggingEnabled, isObserved, registerMetricsCaptor, registerObservationRegistry, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrackMethods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentDescription, getComponentName, getComponentSource, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.beans.factory.BeanNameAware
setBeanNameMethods inherited from interface reactor.core.CoreSubscriber
currentContextMethods inherited from interface org.springframework.integration.support.management.IntegrationManagement
getThisAsMethods inherited from interface org.springframework.integration.mqtt.core.MqttComponent
getBeanNameMethods inherited from interface org.springframework.integration.support.context.NamedComponent
getBeanName, getComponentName
-
Constructor Details
-
MqttPahoMessageHandler
Deprecated, for removal: This API element is subject to removal in a future version.Use this constructor when you don't need additionalMqttConnectOptions.- Parameters:
url- The URL.clientId- The client id.
-
MqttPahoMessageHandler
Deprecated, for removal: This API element is subject to removal in a future version.Use this constructor for a single url (although it may be overridden if the server URI(s) are provided by theMqttConnectOptions.getServerURIs()provided by theMqttPahoClientFactory).- Parameters:
url- the URL.clientId- The client id.clientFactory- The client factory.
-
MqttPahoMessageHandler
Deprecated, for removal: This API element is subject to removal in a future version.Use this constructor if the server URI(s) are provided by theMqttConnectOptions.getServerURIs()provided by theMqttPahoClientFactory.- Parameters:
clientId- The client id.clientFactory- The client factory.- Since:
- 4.1
-
MqttPahoMessageHandler
public MqttPahoMessageHandler(ClientManager<org.eclipse.paho.client.mqttv3.IMqttAsyncClient, org.eclipse.paho.client.mqttv3.MqttConnectOptions> clientManager) Deprecated, for removal: This API element is subject to removal in a future version.Use this constructor when you need to use a singleClientManager(for instance, to reuse an MQTT connection).- Parameters:
clientManager- The client manager.- Since:
- 6.0
-
-
Method Details
-
getConnectionInfo
public org.eclipse.paho.client.mqttv3.MqttConnectOptions getConnectionInfo()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:MqttComponentReturn information about the connection.- Specified by:
getConnectionInfoin interfaceMqttComponent<org.eclipse.paho.client.mqttv3.MqttConnectOptions>- Specified by:
getConnectionInfoin interfaceMqttPahoComponent- Returns:
- the information.
-
onInit
protected void onInit()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:IntegrationObjectSupportSubclasses may implement this for initialization logic.- Overrides:
onInitin classAbstractMqttMessageHandler<org.eclipse.paho.client.mqttv3.IMqttAsyncClient,org.eclipse.paho.client.mqttv3.MqttConnectOptions>
-
doStart
protected void doStart()Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
doStartin classAbstractMqttMessageHandler<org.eclipse.paho.client.mqttv3.IMqttAsyncClient,org.eclipse.paho.client.mqttv3.MqttConnectOptions>
-
doStop
protected void doStop()Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
doStopin classAbstractMqttMessageHandler<org.eclipse.paho.client.mqttv3.IMqttAsyncClient,org.eclipse.paho.client.mqttv3.MqttConnectOptions>
-
publish
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
publishin classAbstractMqttMessageHandler<org.eclipse.paho.client.mqttv3.IMqttAsyncClient,org.eclipse.paho.client.mqttv3.MqttConnectOptions>
-
connectionLost
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
connectionLostin interfaceorg.eclipse.paho.client.mqttv3.MqttCallback
-
messageArrived
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
messageArrivedin interfaceorg.eclipse.paho.client.mqttv3.MqttCallback
-
deliveryComplete
public void deliveryComplete(org.eclipse.paho.client.mqttv3.IMqttDeliveryToken token) Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
deliveryCompletein interfaceorg.eclipse.paho.client.mqttv3.MqttCallback
-
spring-integration-mqtt-clientmodule.