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

Question: Key Shared sample.

Open JimmyBjorklund opened this issue 2 years ago • 1 comments

Looking for a sample on how to setup a producer and consumers using key shared. Using the pulsar node client, the only samples i can find are using java and thy have a key attribute that is not in the node api what i can see.

In the ProducerMessage there is a orderingKey, is this the corresponding key that will be used? When setting the ConsumerConfig.subscriptionType = KeyShared

Thanks for any input. /J

JimmyBjorklund avatar Nov 14 '23 13:11 JimmyBjorklund

In the ProducerMessage there is a orderingKey, is this the corresponding key that will be used? When setting the ConsumerConfig.subscriptionType = KeyShared

Yes. You can refer to: https://pulsar.apache.org/docs/3.1.x/concepts-messaging/#key_shared

It works with orderingKey or partitionKey .

shibd avatar Nov 15 '23 00:11 shibd