Integration / Apache Pulsar Interview questions
Explain the lifecycle of a message in Pulsar from produce to acknowledge?
A producer connects to the broker currently owning the target topic (discovered via a lookup against the metadata store) and sends a message, optionally batched with others and assigned a sequence ID for deduplication.
The owning broker validates the message against the topic's configured schema, applies routing (for partitioned topics), and forwards the entry to a BookKeeper ensemble, waiting for the configured ack quorum of bookies to durably confirm the write before acknowledging success back to the producer.
Once durably stored, the message becomes available to every active subscription on the topic; the broker dispatches it according to each subscription's type, pushing it to the appropriate connected consumer(s).
A consumer processes the message and sends an acknowledgment back to the broker, which advances that subscription's cursor position (itself persisted, via a managed ledger) so the message is no longer part of that subscription's backlog; if left unacknowledged, it remains eligible for redelivery.
Once every subscription on the topic has acknowledged a message and the configured retention window (if any) allows it, the message becomes eligible for deletion from BookKeeper, or for offload to tiered storage if it's aged past the offload threshold instead.
sequenceDiagram participant P as Producer participant B as Broker participant BK as BookKeeper ensemble participant C as Consumer P->>B: Publish message (lookup + send) B->>BK: Write entry to ledger BK-->>B: Ack quorum confirms durable write B-->>P: Publish acknowledged B->>C: Dispatch per subscription type C-->>B: Acknowledge B->>B: Advance subscription cursor
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
