Skip to content

Producer#flush doesn't respect non-batched messages #51

@equanz

Description

@equanz

Search before asking

  • I searched in the issues and found nothing similar.

Version

main( ba1a7e1 )

Minimal reproduce step

  1. Create a producer with batchingEnabled=false
  2. Send some messages asynchronously
  3. Call Producer#flush or Producer#flushAsync
  4. (Close a producer)
  • to get AlreadyClosed exception
    // ensure any remaining send callbacks are called before calling the close callback
    failPendingMessages(ResultAlreadyClosed, false);

What did you expect to see?

When Producer#flush or Producer#flushAsync is called, wait for the completion of sending messages, even if non-batched messages.

What did you see instead?

Producer#flush and Producer#flushAsync don't guarantee the completion of sending non-batched messages.

Anything else?

Currently, ProducerImpl#flushAsync do nothing if batchMessageContainer_ is not initialized.

} else {
callback(ResultOk);
}

In Java client, wait last sent messages. We should implement C++ client like it.
apache/pulsar#2103

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions