Reputation: 2301
I want to use Spring Integration to process MQTT messages.
This is my processing requirements: based on inbound message payload it should be copied to multiple messages with same payload but different headers. More specifically different MQTT topic header since I want to send them to different topics.
Also outbound messages should be sent in order: at first all transformed messages from the 1st inbound message, then all messages from the 2nd inbound messages etc.
What message endpoint(s) should I use to implement this?
Upvotes: 1
Views: 387
Reputation: 6106
So, what you're describing is actually not MQTT specific, rather an enterprise integration pattern called splitter and Spring Integration provides support for it which you can configure using XML, Annotation and/or Java DSL. You can find more info here.
In a nut shell Splitter is a Message Handler with a specific contract allowing it to return "many" from a "single" (kind of the reverse of aggregator). You basically receive a message (from MQTT in your case) and split it on multiple messages inside your splitter implementation.
Upvotes: 3