Class DefaultMqttPahoClientFactory
java.lang.Object
org.springframework.integration.mqtt.core.DefaultMqttPahoClientFactory
- All Implemented Interfaces:
MqttPahoClientFactory
Creates a default
MqttClient and a set of options as configured.- Since:
- 4.0
- Author:
- Gary Russell, Gunnar Hillert
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.paho.client.mqttv3.IMqttAsyncClientgetAsyncClientInstance(String uri, String clientId) Retrieve an async client instance.org.eclipse.paho.client.mqttv3.IMqttClientgetClientInstance(String uri, String clientId) Retrieve a client instance.org.eclipse.paho.client.mqttv3.MqttConnectOptionsRetrieve the connection options.Get the consumer stop action.voidsetConnectionOptions(org.eclipse.paho.client.mqttv3.MqttConnectOptions options) Set the preconfiguredMqttConnectOptions.voidsetConsumerStopAction(ConsumerStopAction consumerStopAction) Set the consumer stop action.voidsetPersistence(org.eclipse.paho.client.mqttv3.MqttClientPersistence persistence) Set the persistence to pass into the client constructor.
-
Constructor Details
-
DefaultMqttPahoClientFactory
public DefaultMqttPahoClientFactory()
-
-
Method Details
-
setPersistence
public void setPersistence(org.eclipse.paho.client.mqttv3.MqttClientPersistence persistence) Set the persistence to pass into the client constructor.- Parameters:
persistence- the persistence to set.
-
getConsumerStopAction
Get the consumer stop action.- Specified by:
getConsumerStopActionin interfaceMqttPahoClientFactory- Returns:
- the consumer stop action.
- Since:
- 4.2.3
-
setConsumerStopAction
Set the consumer stop action. Determines whether we unsubscribe when the consumer stops. Default:ConsumerStopAction.UNSUBSCRIBE_CLEAN.- Parameters:
consumerStopAction- the consumer stop action.- Since:
- 4.2.3.
-
getClientInstance
public org.eclipse.paho.client.mqttv3.IMqttClient getClientInstance(String uri, String clientId) throws org.eclipse.paho.client.mqttv3.MqttException Description copied from interface:MqttPahoClientFactoryRetrieve a client instance.- Specified by:
getClientInstancein interfaceMqttPahoClientFactory- Parameters:
uri- The URL.clientId- The client id.- Returns:
- The client instance.
- Throws:
org.eclipse.paho.client.mqttv3.MqttException- Any.
-
getAsyncClientInstance
public org.eclipse.paho.client.mqttv3.IMqttAsyncClient getAsyncClientInstance(String uri, String clientId) throws org.eclipse.paho.client.mqttv3.MqttException Description copied from interface:MqttPahoClientFactoryRetrieve an async client instance.- Specified by:
getAsyncClientInstancein interfaceMqttPahoClientFactory- Parameters:
uri- The URL.clientId- The client id.- Returns:
- The client instance.
- Throws:
org.eclipse.paho.client.mqttv3.MqttException- Any.
-
setConnectionOptions
public void setConnectionOptions(org.eclipse.paho.client.mqttv3.MqttConnectOptions options) Set the preconfiguredMqttConnectOptions.- Parameters:
options- the options.- Since:
- 4.3.16
-
getConnectionOptions
public org.eclipse.paho.client.mqttv3.MqttConnectOptions getConnectionOptions()Description copied from interface:MqttPahoClientFactoryRetrieve the connection options.- Specified by:
getConnectionOptionsin interfaceMqttPahoClientFactory- Returns:
- The options.
-