apache / apache/pulsar-adapters

PulsarKafkaProducer/Consumer do not set required configuration properties.

Open
#27 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
24
Forks
30
PR merge metrics
No merged PRs in 30d

Description

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

org.apache.pulsar
pulsar-client-kafka-original
2.8.0

```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the PulsarKafkaProducer and PulsarKafkaConsumer constructors used in the reproduction and trace how the supplied serializer and deserializer instances are handled. Run the provided Java example against the 2.8.0 adapter, then add regression coverage for construction without serializer or deserializer properties; done means both constructors no longer report those required configuration errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kafka
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.