How it works
A user makes a POST request to the API gateway, which is an entry point for the user management service to register users. The API gateway, in turn, makes an RPC Call (Remote procedure call) to the createUser method in the management service. The createUser endpoint performs a set of validations on the user input. If the input is invalid, it will throw an exception, and return the error to the API gateway. Once the user input is validated, the user is registered, and UserCreatedEvent is triggered to get published in Kafka. In Kafka, partitions capture the events. In our example, the users topic has three partitions, so the event will be published to one of the three partitions based on some defined logic; this logic is defined ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access