pulsar-client-go icon indicating copy to clipboard operation
pulsar-client-go copied to clipboard

DLQ producer creation fails on topic with schema

Open GPrabhudas opened this issue 3 years ago • 1 comments

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.

GPrabhudas avatar Feb 15 '22 13:02 GPrabhudas

@sijie can we please get a review on this PR

chiragbparikh avatar Mar 01 '22 00:03 chiragbparikh