You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "nareshv (via GitHub)" <gi...@apache.org> on 2023/03/16 04:09:30 UTC
[GitHub] [pulsar-adapters] nareshv commented on a diff in pull request #46: [Issue #45] [pulsar-client-kafka-compat] Handled Kafka record headers…
nareshv commented on code in PR #46:
URL: https://github.com/apache/pulsar-adapters/pull/46#discussion_r1138092950
##########
pulsar-client-kafka-compat/pulsar-client-kafka/src/test/java/org/apache/kafka/clients/producer/PulsarKafkaProducerTest.java:
##########
@@ -246,7 +248,13 @@ public void testPulsarKafkaSendAvro() throws PulsarClientException {
foo.setField2("field2");
foo.setField3(3);
- pulsarKafkaProducer.send(new ProducerRecord<>("topic", 1,foo, bar));
+ Headers headers = new RecordHeaders();
+ String header1 = "header1";
+ String header2 = "header2";
+ headers.add(header1,header1.getBytes());
+ headers.add(header2,header2.getBytes());
+
+ pulsarKafkaProducer.send(new ProducerRecord<>("topic", 1,foo, bar, headers));
Review Comment:
can you also add a test to confirm these headers are seen in their original form in the `KafkaConsumerRecord` as well ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org