I have two payloads and want to merge them into single JSON object (streaming join). At few places people are suggesting to use AttributesToJSON, but as one of the JSON does not
Easy! Just use MergeContent
and set the following configuration:
Merge Format: Binary Concatenation
Minimum Number of Entries: 2
Delimiter Strategy: Text
Header: [
Footer: ]
Demarcator: ,
(You could use MergeRecord
but it is a little buggy for me at least).
Then transfer to JoltTrasnformJSON
and set Jolt Transformation DSL
to Shift
and Jolt Specification
to:
{
"*": {
"*": "&"
}
}
This should do the job :)
Generally NiFi is not meant to do traditional streaming joins, but this recent thread on the mailing list can help explain what is possible:
http://apache-nifi-users-list.2361937.n4.nabble.com/join-two-datasets-td7039.html