From fe8bc7b0ea952642428f916240be997ada148026 Mon Sep 17 00:00:00 2001 From: gk-kindred <118979108+gk-kindred@users.noreply.github.com> Date: Mon, 29 Jul 2024 09:56:55 +1000 Subject: [PATCH] fix: pass headers received from on_commit actions (#101) --- .../talos_messenger_actions/src/messenger_with_kafka.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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();