GitHub user maozhitao12450 added a comment to the discussion: Why don't
org.apache.pulsar.client.api.Producer and org.apache.pulsar.client.api.Consumer
provide an isClose method?
Today I tried to add wrapper to the producer.
Interestingly, if the producer is closed in a way other than
producer.closeAsync();
I cannot know that it has been closed by listening to the
AlreadyClosedException thrown by Producer#send. Actualy,send-action is trigger
by TypedMessageBuilder
```java
MessageId messageId = producer.newMessage().value("Hello Pulsar").send();
````
I have to add another wrapper for TypedMessageBuilder, which is too
troublesome.
If possible, a listener for the close event should be added or a simple status
judgment (isClose) should be provided.
I communicated with Lari Hotari and felt that adding an event listener would be
better.
GitHub link:
https://github.com/apache/pulsar/discussions/20510#discussioncomment-6120340
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]