Search code examples
apache-pulsar

Pulsar message acknowledge applies on topic or subscription?


I'm new to Pulsar and after reading some document I am a little bit confusing about message acknowledge.

Say, I have one topic, and two subscriptions: SubA and SubB. Now a message is consumed by SubA and SubB, but only SubA acknowledged that message. Now my question is, say after 2 days, our retention policy kicks in and it want to delete all acknowledged message older than 2 days, then in this case, is the message considered acknowledged or not? (because only SubA acknowledged it, SubB didn't)


Solution

  • The message is considered not acknowledged and will not be deleted. It is still being held for delivery in subscription SubB. Messages need to be acknowledged in all subscriptions before they are removed.

    Like a traditional message broker, Pulsar keeps unacknowledged messages indefinitely. If this is not what you want, you can configure message TTL, which acknowledges a message after a configurable amount of time.