Skip to content

Latest commit

 

History

History
55 lines (32 loc) · 1.49 KB

README.md

File metadata and controls

55 lines (32 loc) · 1.49 KB

MQTT Spring Cloud Stream Binder client library for Java

The project provides Spring Cloud Stream Binder for MQTT which allows you to build message-driven microservice using Spring Cloud Stream

Usage

Include the package

Add dependency

<dependency>
  <groupId>org.springframework.cloud</groupId>
  <artifactId>spring-cloud-stream-binder-mqtt</artifactId>
  <version>0.0.1-SNAPSHOT</version>
</dependency>

Configuration Options

The binder provides the following configuration options in application.properties.

MQTT Binder Properties

spring.cloud.stream.mqtt.binder.serverHost

Location of the mqtt broker. Default localhost

spring.cloud.stream.mqtt.binder.serverPort

Port of the mqtt broker. Default 1883

spring.cloud.stream.mqtt.binder.username

The username to use when connecting to the broker. Default guest

spring.cloud.stream.mqtt.binder.password

The password to use when connecting to the broker. Default guest

Mqtt Consumer Properties

The following properties are available for MQTT consumers only and must be prefixed with spring.cloud.stream.mqtt.bindings.<channelName>.consumer.

clientId

Identifies the client. Default: stream.client.id.source

Mqtt Producer Properties

The following properties are available for MQTT consumers only and must be prefixed with spring.cloud.stream.mqtt.bindings.<channelName>.producer.

clientId

Identifies the client. Default: stream.client.id.sink