diff --git a/packages/talos_messenger_actions/src/messenger_with_kafka.rs b/packages/talos_messenger_actions/src/messenger_with_kafka.rs index 59062220..dd123ed2 100644 --- a/packages/talos_messenger_actions/src/messenger_with_kafka.rs +++ b/packages/talos_messenger_actions/src/messenger_with_kafka.rs @@ -51,13 +51,19 @@ where total_publish_count: additional_data, }; + let mut headers_to_publish = headers; + + if let Some(payload_header) = payload.headers { + headers_to_publish.extend(payload_header); + } + self.publisher .publish_to_topic( &payload.topic, payload.partition, payload.key.as_deref(), payload_str, - headers, + headers_to_publish, Box::new(delivery_opaque), ) .unwrap();