Files
spring-integration-samples/basic/mqtt
Artem Bilan ef31a187c4 Revert usage for fileNameExpression
Since we provide a custom `FileNameGenerator` via `fileNameExpression` we should ensure somehow `BeanFactory` injection to that
`FileWritingMessageHandlerSpec` is a `FactoryBean` since version DSL `1.2` and a particular `BPP` takes care about `Spec` internals and register custom `FileNameGenerator` as a bean.

 Use standard `FactoryBean` injection in the `lines()` flow to populate the target `FileWritingMessageHandler` to the flow
Generate pom for all project to apply SI Java DSL 1.2 GA
2016-10-14 13:28:27 -04:00
..
2016-03-07 10:10:29 -05:00
2016-10-14 13:28:27 -04:00
2016-03-07 10:10:29 -05:00

Spring Integration - MQTT Sample

Overview

This sample demonstrates basic functionality of the Spring Integration MQTT Adapters.

It assumes a broker is running on localhost on port 1883.

Once the application is started, you enter some text on the command prompt and a message containing that entered text is dispatched to the MQTT topic. In return that message is retrieved by Spring Integration and then logged.

How to Run the Sample

If you imported the example into your IDE, you can just run class org.springframework.integration.samples.mqtt.Application. For example in SpringSource Tool Suite (STS) do:

  • Right-click on SampleSimple class --> Run As --> Spring Boot App

(or run from the boot console).

Alternatively, you can start the sample from the command line:

  • ./gradlew :mqtt:run

Enter some data (e.g. foo) on the console; you will see foo sent to MQTT, received from MQTT

Ctrl-C to terminate.