Skip to content

Latest commit

 

History

History
31 lines (17 loc) · 1.07 KB

File metadata and controls

31 lines (17 loc) · 1.07 KB

WebFlux: Spring Integration Java DSL

This sample demonstrates the usage of the WebFlux protocol adapter to split incoming messages to different routes and provide the results as SSE events.

NOTE: at the time of this writing, the WebFlux integration drops POST messages with empty request body

Run the Sample

  • You need Java 8 to run this sample, because it is based on Lambdas.

  • running the WebFluxApplication class from within STS (Right-click on Main class --> Run As --> Java Application)

  • or from the command line in the webflux folder:

    $ mvn spring-boot:run

Interact with the Sample

The sample expects messages containing a JSON array where possible items are "latte macchiato"" or "caffe".

$ curl -v -d "[\"latte macchiato\", \"caffe\"]" -H "Content-Type: application/json" http://localhost:8080/messages

To listen for SSE events:

$ curl localhost:8080/events

Whenever a message is processed, a corresponding event will be sent to the /events resource.

data:"latte macchiato"

data:"caffe"