Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PulsarKafkaProducer/Consumer do not set required configuration properties. #27

Open
afedulov opened this issue Jul 29, 2021 · 0 comments

Comments

@afedulov
Copy link

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant