Let's say I have a custom module in Spring XD (I'm using Spring XD + Spring Integration + hibernate). The module basically gets something from the DB (let's say I store it using an hibernate entity, so I use an objet called "DataFromDB"). DataFromDB is a list, then I get each element from the list and I want to send it using something like:
String payload = convertDataFromDBToJson(record);
return MessageBuilder.createMessage(payload, message.getHeaders());
If you return a
Collection<Message<?>>, they will be sent as separate messages.