Consumer.acknowledge() not registered in client

Open
#385 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript, node.js

Research direction

Start by reproducing the while loop using consumer.receive() and acknowledge() around the axios processing call, comparing acknowledgement before and after the API request. Check whether receive() returns already acknowledged messages until its timeout, and use pulsar-admin to compare the topic-partition state while the client runs. Done means acknowledgements after processing prevent further delivery of those messages without requiring a client restart.

Written by the indexing model from the issue text.

Description

After receiving a message, our script makes an API call through axios to process the pulsar message. consumer.receive() and the processing logic runs in a while loop until receive() times out when the queue is empty.

It appears if we run acknowledge() prior to the API call, the client behaves correctly, that is messages are acked and receive does not receive any more messages once all messages are acked.

But running ack after the API call, the desired way to ack the message, it seems as receive() goes in a loop and keeps receiving messages already acked. However if we quit the script and re-run it, the queue is indeed empty and no messages are received, similarly peaking the messages through pulsar-admin for the given topic-partition while the script is running confirm messages are acked.

Dominant language
C++
Stars
164
Forks
99
Avg merge
5d 18h
Merged PRs (30d)
2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/pulsar-client-node

All issues in apache/pulsar-client-node

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.