You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating KeyShared Consumers, I have found that all messages published to their topic are consumed by each consumer, resulting in duplicates of each message published to their topic.
I was unable to find Go client documentation that covered Consumer configurations with a KeyShared type. I believe I would like to use the KeySharedPolicyModeAutoSplit, since it seems to cover most use cases.
Please let me know if there is any additional configuration needed to get past this issue - here is my consumer creation code:
Original Issue: apache#736
When creating KeyShared Consumers, I have found that all messages published to their topic are consumed by each consumer, resulting in duplicates of each message published to their topic.
I was unable to find Go client documentation that covered Consumer configurations with a KeyShared type. I believe I would like to use the KeySharedPolicyModeAutoSplit, since it seems to cover most use cases.
Please let me know if there is any additional configuration needed to get past this issue - here is my consumer creation code:
properties := make(map[string]string)
jsonSchemaWithProperties := pulsar.NewJSONSchema(schema, properties)
consumer, err := client.Subscribe(pulsar.ConsumerOptions{ Topic: topic, SubscriptionName: subscriptionName, Schema: jsonSchemaWithProperties, Type: pulsar.KeyShared, KeySharedPolicy: &pulsar.KeySharedPolicy{ Mode: pulsar.KeySharedPolicyModeAutoSplit, }, })
And the producer that publishes to the topic:
properties := make(map[string]string)
jsonSchemaWithProperties := pulsar.NewJSONSchema(schema, properties)
producer, err := client.CreateProducer(pulsar.ProducerOptions{ Topic: topic, Schema: jsonSchemaWithProperties, HashingScheme: pulsar.Murmur3_32Hash, BatcherBuilderType: pulsar.KeyBasedBatchBuilder, })
Thank you in advance for any guidance and feedback you're able to provide.
The text was updated successfully, but these errors were encountered: