Chapter 13. Integrating Event-Driven and Request-Response Microservices

As powerful as event-driven microservice patterns are, they cannot serve all of the business needs of an organization. Request-response endpoints provide the means to serve important data in real time, particularly when you are:

  • Collecting metrics from external sources, such as an application on a user’s cell phone or Internet of Things (IoT) devices

  • Integrating with existing request-response applications, particularly third-party ones outside of the organization

  • Serving content in real time to web and mobile device users

  • Serving dynamic requests based on real-time information, such as location, time, and weather

Event-driven patterns still play a large role in this domain, and integrating them with request-response solutions will help you leverage the best features of both.

Note

For the purposes of this chapter, the term request-response services refers to services that communicate with each other directly, typically through a synchronous API. Two services communicating via HTTP is a prime example of request-response communication.

Handling External Events

Due to history, precedence, familiarity, convenience, and a whole host of other reasons, external events are predominantly sent from the outside via a request-response API. While it is possible to expose an event broker and its streams to an external client, it is largely unreasonable to do so, as you would need to resolve a number of issues ...

Get Building Event-Driven Microservices 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.