File tree 1 file changed +5
-0
lines changed
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -520,16 +520,21 @@ function * downloadFile (fileURL) {
520
520
/**
521
521
* Wrapper function to post to bus api. Ensures that every event posted to bus api
522
522
* is duplicated and posted to bus api again, but to a different "aggregate" topic
523
+ * Also stores the original topic in the payload
523
524
* @param {Object } payload Data that needs to be posted to the bus api
524
525
*/
525
526
function * postToBusApi ( payload ) {
526
527
const busApiClient = getBusApiClient ( )
528
+ const originalTopic = payload [ 'topic' ]
527
529
528
530
yield busApiClient . postEvent ( payload )
529
531
530
532
// Post to aggregate topic
531
533
payload [ 'topic' ] = config . get ( 'KAFKA_AGGREGATE_TOPIC' )
532
534
535
+ // Store the original topic
536
+ payload [ 'payload' ] [ 'originalTopic' ] = originalTopic
537
+
533
538
yield busApiClient . postEvent ( payload )
534
539
}
535
540
You can’t perform that action at this time.
0 commit comments