pulsar-client-go
pulsar-client-go copied to clipboard
DLQ producer creation fails on topic with schema
Expected behaviour
Schema compatibility: Forword-transitive
for example
DLQ producer creation should not fail with an error
Actual behavior
DLQ producer creation fails with schema incompatibility error.
ERRO[0004] [Failed to create producer] error="server error: IncompatibleSchema:
org.apache.pulsar.broker.service.schema.exceptions.IncompatibleSchemaException: Producers cannot connect or send message without a schema to topics with a schema caused by
org.apache.pulsar.broker.service.schema.exceptions.IncompatibleSchemaException: Producers cannot connect or send message without a schema to topics with a schema" topic=DLQ_TOPIC
Steps to reproduce
Use policy on topic to use Schema compatibility: Forword-transitive
try to create consumer as follows
consumer, err := client.Subscribe(pulsar.ConsumerOptions{
Topic: TOPIC, // topic with schema
SubscriptionName: "consumer-subscription-01",
Schema: pulsar.NewAvroSchema("avro schema", nil), // topic with schema
Type: pulsar.Shared,
NackRedeliveryDelay: 1 * time.Second,
DLQ: &pulsar.DLQPolicy{
MaxDeliveries: 3,
DeadLetterTopic: DLQ_TOPIC, // topic with schema
},
})
Here producer creation on topic DLQ_TOPIC
fails.
@sijie can we please get a review on this PR