When sales events arrive from several branches, merge() combines uniform streams into one stream for continued processing. Its behavior resembles SQL UNION: elements from both inputs enter the resulting stream. section 12.2.1
Combine branch sales streams
salesDataNorth.merge(salesDataSouth) creates one stream containing sales data from the northern and southern branches, suitable for downstream processing in a central Kafka environment. section 12.2.1
salesDataNorth.merge(salesDataSouth)
Inspect the concise processor expression that merges the northern and southern sales streams. section 12.2.1
Use merge alongside related stream processors:
- Use filter() to select records, map() to transform them, and merge() to combine compatible streams. section 12.2.1
- Choose joins when combining streams or tables through database-style relationships rather than simply appending uniform inputs. section 12.2.1
- Choose split() when one stream must branch into multiple condition-based outputs instead of becoming a single combined stream. section 12.2.1




