Skip to content

Commit 879e6fb

Browse files
committed
Use producev to support headers in kafka
1 parent acb978a commit 879e6fb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg/rdkafka/RdKafkaProducer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function send(Destination $destination, Message $message): void
4242
$key = $message->getKey() ?: $destination->getKey() ?: null;
4343

4444
$topic = $this->producer->newTopic($destination->getTopicName(), $destination->getConf());
45-
$topic->produce($partition, 0 /* must be 0 */, $payload, $key);
45+
$topic->producev($partition, 0 /* must be 0 */, $payload, $key, $message->getHeaders());
4646
}
4747

4848
/**

pkg/rdkafka/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"license": "MIT",
88
"require": {
99
"php": "^7.1.3",
10-
"ext-rdkafka": "^3.0.3",
10+
"ext-rdkafka": "^3.1.0",
1111
"queue-interop/queue-interop": "^0.7|^0.8"
1212
},
1313
"require-dev": {

0 commit comments

Comments
 (0)