Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify the different behaviors of pulsar sink when auto-ack is true/false #16716

Closed
1 task done
truong-hua opened this issue Jul 21, 2022 · 6 comments
Closed
1 task done
Labels
doc-required Your PR changes impact docs and you will update later. Stale

Comments

@truong-hua
Copy link

What issue do you find in Pulsar docs?

The doc does not clearly describe the behavior of a sink when the auto-ack is disabled and whether the auto-ack = true is always reliable for any cases and should be the only option or not.

In reality, we are facing some missed data in sink while our cluster is changing. We are only using rabbitmq as sink destination so we are now would like to understand more about the auto-ack methodology of pulsar to better understand the situation and somehow resolve our problem.

What is your suggestion?

We would like to know more what should we add to a sink if auto-ack is set to false.

Secondly, we would like to know if auto-ack = true, when a sink ack a message and when it nack a message, and whether it's 100% reliable or not? Let's say there is no any problem with the sink destination service (in our case it's RabbitMQ).

Do you have any references?

Nope

Would you like to fix this issue?

Nope

Note

  • I have researched my question.
@shibd
Copy link
Member

shibd commented Jul 22, 2022

This is related to the function framework.

When Guarantees == ATMOST_ONCE and autoAck == true, The message will be ack before it enters sink connector.

In other cases auto-ack has no effect on the sink connector, the sink connector needs to ack himself.

auto-ack is a confusing configuration, you can see this PIP-166, it will plan deprecated that config.

@shibd
Copy link
Member

shibd commented Jul 22, 2022

If you use RabbitMQ sink connector from pulsar repository, When Guarantees != ATMOST_ONCE, auto-ack configuration has no effect on message ack, because the current implementation is internally ack every time.

String routingKey = record.getProperties().get("routingKey");
rabbitMQChannel.basicPublish(exchangeName,
StringUtils.isEmpty(routingKey) ? defaultRoutingKey : routingKey, null, value);
record.ack();

@nlu90
Copy link
Member

nlu90 commented Jul 22, 2022

  1. when you are confident the message is successfully processed, you should ack it.
  2. if auto-ack is true, the message is acked when it's first received by the function/connector. No nack is invoked IIRC.

@shibd
Copy link
Member

shibd commented Jul 22, 2022

if auto-ack is true, the message is acked when it's first received by the function/connector. No nack is invoked IIRC.

And also need Guarantees == ATMOST_ONCE?

@github-actions
Copy link

The issue had no activity for 30 days, mark with Stale label.

@github-actions github-actions bot added the Stale label Aug 22, 2022
@momo-jun
Copy link
Contributor

Closed the issue since it has been addressed. Feel free to reopen it when it's relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-required Your PR changes impact docs and you will update later. Stale
Projects
None yet
Development

No branches or pull requests

4 participants