You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "swamymavuri (via GitHub)" <gi...@apache.org> on 2023/03/21 22:02:15 UTC

[GitHub] [pulsar-adapters] swamymavuri commented on a diff in pull request #46: [Issue #45] [pulsar-client-kafka-compat] Handled Kafka record headers…

swamymavuri commented on code in PR #46:
URL: https://github.com/apache/pulsar-adapters/pull/46#discussion_r1144033792


##########
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:
   Hi @nareshv ,
   Added KafkaConsumer test classes in`PulsarKafkaConsumerTest ` to cover the code flow of header section along with the existing code flow.
   As there are no integration test cases readily available for this to run either with server/docker container. so validation of the headers in the consumer is not possible at this moment.
   I will raise an issue and we can work for integration test cases later.



-- 
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