Skip to content
Discussion options

You must be logged in to vote

Make sense. After all in the reported case @maozhitao12450 has access to the producer. And you may wrap up your own producer extend:

public class ProducerExtend implements AutoClosable {
  public final Producer producer;
  public final AtomicBoolean closed = new AtomicBoolean();

  @Override
  public void close() throws Exception {
    // follow the comments above
  }
}

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@tisonkun
Comment options

tisonkun Jun 8, 2023
Collaborator

Answer selected by maozhitao12450
@maozhitao12450
Comment options

Comment options

You must be logged in to vote
2 replies
@tisonkun
Comment options

tisonkun Jun 8, 2023
Collaborator

@tisonkun
Comment options

tisonkun Jun 8, 2023
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants