Building event-driven microservices

In Chapter 9, Asynchronous API Design, we learned about asynchronous programming. An asynchronous API can be achieved by events. The service and client can talk to each other using events. They don't have to wait until one party finishes their job.

An event generator is an entity that generates events. An event consumer consumes the events from other parties. Publish/Subscribe is an architectural pattern that is possible with events. Go Micro supports Publish/Subscribe by using a message broker interface.

See the following diagram to understand the event flow:

A Go Micro client can Subscribe to a topic. ...

Get Hands-On RESTful Web Services with Go - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.