Skip to content

Cloning/Duplicating Messages #1346

Answered by Jeffail
newlandk asked this question in Q&A
Jul 26, 2022 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Hey @newlandk, there's lots of different ways of doing this sort of stuff so it's hard to recommend one standard way. Normally I'd say to use a broker output with a fan_out and output level processors to do this, but then you're limited to having single threaded processing per output.

Another way is to use https://www.benthos.dev/docs/components/processors/select_parts to select a message multiple times parts: [ 0, 0 ] and then use the bloblang function batch_index to identify which index you're mapping.

A cleaner way (in my opinion) is to use branches to process different masks of a message that combines both duplicates, you could shape a message to look something like this {"id":"1","fo…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@newlandk
Comment options

Answer selected by newlandk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants