Skip to content

Possible message loss: messages are acknowledged without taking message sending result into account #25

@lhotari

Description

@lhotari

Hi,
I'm one of the Apache Pulsar developers and I was interested to see how Pulsar client is used in this code base.

I spotted a potential problem: Messages are acknowledged without taking message sending result into account.

Sending happens asynchronously here:

.sendAsync()
.exceptionally(t -> {
log.error("Failed to send Pulsar message", t);
return null;
}) .thenRun(() -> {});

Acknowledgement is done without taking message sending result into account:

One possible solution is to ack the message in the thenRun callback in sendPulsarMessage. Detected duplicates could be acked immediately.

Metadata

Metadata

Assignees

No one assigned

    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