Files
spring-integration-extensions/spring-integration-mqtt
Gary Russell 76c65ec6db INTEXT-89 Fix Inbound Stop When No Server
The reconnection task was not canceled in doStop().
2013-10-02 13:44:52 -04:00
..
2013-05-15 16:46:42 -04:00
2013-05-15 16:46:42 -04:00
2013-05-15 16:46:42 -04:00
2013-05-15 16:46:42 -04:00
2013-05-24 15:16:29 -04:00

Spring Integration MQTT Support

inbound and outbound channel adapters are provided for MQ Telemetry Transport (MQTT). The current implementation uses the Eclipse Paho client.

Example Configurations

<int-mqtt:message-driven-channel-adapter id="twoTopicsAdapter"
	client-id="foo"
	url="tcp://localhost:1883"
	topics="bar, baz"
	channel="out" />

<int-mqtt:outbound-channel-adapter id="withDefaultConverter"
		client-id="foo"
		url="tcp://localhost:1883"
		default-qos="1"
		default-retained="true"
		default-topic="bar"
		channel="target" />

Spring Integration messages sent to the outbound adapter can have headers mqtt_topic, mqtt_qos, mqtt_retained which will override the defaults configured on the adapter.

Inbound messages will have headers

mqtt_topic       - the topic from which the message was received
mqtt_duplicate   - true if the message is a duplicate
mqtt_qos         - the quality of service

Both adapters use a MqttPahoClientFactory to get a client instance; the same factory also provides connection options from configured properties (such as user/password). The client factory bean (DefaultMqttPahoClientFactory) is provided to the adapter using the client-factory attribute. When not provided, a default factory instance is used.

Currently tested with the RabbitMQ MQTT plugin.

Maven

Repository

<repository>
    <id>repository.springframework.maven.milestone</id>
    <name>Spring Framework Maven Milestone Repository</name>
    <url>http://repo.springsource.org/milestone</url>
</repository>

Artifact

<dependency>
    <groupId>org.springframework.integration</groupId>
    <artifactId>spring-integration-mqtt</artifactId>
    <version>1.0.0.M1</version>
</dependency>

Support

Check out the Spring Integration forums and the spring-integration tag on Stack Overflow. Commercial support is available, too.

Resources

For more information, please also don't forget to visit the Spring Integration website.