Skip to content

Conversation

@RobertIndie
Copy link
Contributor

Motivation

When a topic that a pattern consumer is subscribed to is deleted, the consumer's sub-consumer tries to reconnect. However, it encounters a "topic not found" error. Currently, this error causes all pending waiters to fail, leading to an AlreadyClosedException when consumer.ReceiveAsync() is called. This issue can disrupt other consumers.

Pulsar.Client.Api.AlreadyClosedException: Consumer is already closed
   at <StartupCode$Pulsar-Client>[email protected]() in xxx/src/Pulsar.Client/Internal/ConsumerImpl.fs:line 1444
   at [email protected](ResumableStateMachine`1& sm)
   at [email protected](ResumableStateMachine`1& sm)

To fix this, if a sub-consumer encounters a "topic not found" error during reconnection, we should simply remove that consumer from the pattern consumer instead of throwing an exception.

Modification

  • This change prevents pending waiters from failing when a consumer encounters a "topic not found" error during reconnection.

@Lanayx Lanayx merged commit f8562cf into fsprojects:develop Jun 20, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants