You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/07/29 15:52:57 UTC

[GitHub] [pulsar-adapters] afedulov opened a new issue #27: PulsarKafkaProducer/Consumer do not set required configuration properties.

afedulov opened a new issue #27:
URL: https://github.com/apache/pulsar-adapters/issues/27


   **Describe the bug**
   ```
    new PulsarKafkaProducer<>(
       props, new StringSerializer(), new StringSerializer<>());
   ```
   fails with
   ```
   org.apache.kafka.common.config.ConfigException: Missing required configuration "key.serializer" which has no default value.
   ```
   Similarly, PulsarKafkaConsumer fails with missing `key.deserializer/value.serializer`.
   
   **To Reproduce**
   ```
   import java.util.Properties;
   import org.apache.kafka.clients.producer.PulsarKafkaProducer;
   import org.apache.kafka.common.serialization.StringSerializer;
   
   public class ReproducePulsarBug {
   
     public static void main(String[] args) {
       Properties props = new Properties();
       props.put("bootstrap.servers", "pulsar://localhost:49377");
   //  Only works if below two lines are commented in:
   //    props.put("key.serializer", StringSerializer.class.getName());
   //    props.put("value.serializer", StringSerializer.class.getName());
       new PulsarKafkaProducer<>(
           props, new StringSerializer(), new StringSerializer());
     }
   }
   ```
   
   **Additional context**
   ```
   <dependency>
       <groupId>org.apache.pulsar</groupId>
       <artifactId>pulsar-client-kafka-original</artifactId>
       <version>2.8.0</version>
   </dependency>
   ```
   


-- 
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: dev-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org