apache / pulsar

Apache Pulsar - distributed pub-sub messaging system
https://pulsar.apache.org/
Apache License 2.0
14.13k stars 3.57k forks source link

Send Key hash range change events to consumers in Key_Shared subscription. #6555

Open codelipenghui opened 4 years ago

codelipenghui commented 4 years ago

Master issue: #4077 Is your feature request related to a problem? Please describe. Send Key hash range change events to consumers in Key_Shared subscription.

zubchenok commented 3 years ago

Please up. Unable to maintain a local consumer cache if I don't know when a key is not served by the consumer any more.

lhotari commented 3 years ago

When adding this feature, would it be possible to support this in the asynchronous API of the Pulsar Java Client too? I guess race conditions could be problematic unless pending receives are completed with exceptions?

codelipenghui commented 3 years ago

@lhotari We have a consumer events listener https://github.com/apache/pulsar/blob/6704f12104219611164aa2bb5bbdfc929613f1bf/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/ConsumerEventListener.java, users need to register a listener for getting the new events of the consumer https://github.com/apache/pulsar/blob/ef06691531002c5d7cdbbdafc5494914ee8e0765/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/ConsumerBuilder.java#L410

tisonkun commented 1 year ago

@codelipenghui Can you share a bit about what the remain works are before we close this issue?

lhotari commented 1 week ago

I have shared an update about on-going design work which will be targeting this requirement, the updates are shared in this GitHub Discussion: https://github.com/apache/pulsar/discussions/22912#discussioncomment-10599466 .