Reputation: 1189
How to achieve this with spring xd?
Input message : {"key" : "temp", "key1" : "a b c"}
Output messages (my requirement): {"key" : "temp", "key1" : "a"} {"key" : "temp", "key1" : "b"} {"key" : "temp", "key1" : "c"}
[Note:I tried to use splitter but splitter is taking whole payload as input.]
Upvotes: 0
Views: 69
Reputation: 174809
It's probably easiest to create a custom splitter module.
You could do it with a bunch of transformers followed by a splitter and more transformers but it would be rather convoluted...
jsonToMap->save key in a header->transform to key1.payload->split on space
->transform back to a map->add key entry back in->mapToJson
Upvotes: 0