56
CHAPTER 3 | Architecting container and microservice-based applications
When the commands come from client
applications, they can be implemented as HTTP synchronous
commands. Use message-based commands when yo
u need higher scalability or when you’re already
in a message-based business process.
Multiple-receivers message-based communication
As
a more flexible approach, you might also want to use a publish/subscribe mechanism so that your
communication from the sender will be available to additional subscriber microservices
or to external
applications. Thus, it helps you to follow the
open/closed principle
in the sending service. That way,
additional subscribers can be added in the future without the need to modify the sender service.
When you use a publish/subscribe communication, you might be using an
event bus interface to
publish events to any subscriber.
Dostları ilə paylaş: