Integration / Apache Pulsar Interview questions
Explain the execution flow of a Pulsar Function processing a message?
The function's instance(s) subscribe to the configured input topic(s) as a regular Pulsar consumer under the hood, receiving each message through the normal subscription and dispatch mechanism just like any other consumer application.
For each received message, the Pulsar Functions runtime invokes the user-provided process method with the message's deserialized value (using the topic's configured schema) plus a context object exposing metadata like message properties, topic name, and access to any configured state store.
Whatever the function returns is published to the configured output topic using the function's own internal producer, with the same durability guarantees as any other Pulsar publish - and by default, only after that output publish succeeds does the function acknowledge the original input message, giving Functions at-least-once (and, in transactional mode, atomic) processing semantics.
If the function needs to maintain state across invocations, like a running count, it can read and write to Pulsar's built-in state store, itself backed by BookKeeper's table service, without the operator needing to stand up a separate external database.
The Functions runtime handles scaling instances, restarting failed instances, and redistributing partitions among instances automatically, so operationally a function behaves like any other managed Pulsar workload rather than a bespoke deployed service.
flowchart LR A[Input topic] --> B[Function consumer receives message] B --> C[Runtime invokes process with value + context] C --> D[Optional: read/write state store] C --> E[Publish result to output topic] E --> F[Acknowledge input message]
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...
