EDIT:
The above method relies on the input messages to be merged having DIFFERENT topic-names.
It is unclear what the topic-name is for your two sets of incoming data and whether a unique topic-name could be applied (at the source where the data is created).