Skip to Content
Architecture Patterns with Python
book

Architecture Patterns with Python

by Harry Percival, Bob Gregory
March 2020
Intermediate to advanced content levelIntermediate to advanced
301 pages
7h 10m
English
O'Reilly Media, Inc.
Book available
Content preview from Architecture Patterns with Python

Chapter 11. Event-Driven Architecture: Using Events to Integrate Microservices

In the preceding chapter, we never actually spoke about how we would receive the “batch quantity changed” events, or indeed, how we might notify the outside world about reallocations.

We have a microservice with a web API, but what about other ways of talking to other systems? How will we know if, say, a shipment is delayed or the quantity is amended? How will we tell the warehouse system that an order has been allocated and needs to be sent to a customer?

In this chapter, we’d like to show how the events metaphor can be extended to encompass the way that we handle incoming and outgoing messages from the system. Internally, the core of our application is now a message processor. Let’s follow through on that so it becomes a message processor externally as well. As shown in Figure 11-1, our application will receive events from external sources via an external message bus (we’ll use Redis pub/sub queues as an example) and publish its outputs, in the form of events, back there as well.

apwp 1101
Figure 11-1. Our application is a message processor
Tip

The code for this chapter is in the chapter_11_external_events branch on GitHub:

git clone https://github.com/cosmicpython/code.git
cd code
git checkout chapter_11_external_events
# or to code along, checkout the previous chapter:
git checkout chapter_10_commands
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.
Start your free trial

You might also like

Python Architecture Patterns

Python Architecture Patterns

Jaime Buelta
Data Structures & Algorithms in Python

Data Structures & Algorithms in Python

John Canning, Alan Broder, Robert Lafore

Publisher Resources

ISBN: 9781492052197Errata PageSupplemental Content