A mediator topology for EDAs uses a single event queue and an event mediator to route events to the relevant event processors. This topology is commonly used when multiple steps are required to process an event.
With the mediator topology, event producers send events into an event queue. There can be many event queues in an EDA. Event queues are responsible for sending event messages on to the event mediator. All of these events, referred to as initial events, go through an event mediator. The event mediator then performs any necessary orchestration:
After the event mediator orchestrates each event from the event queue, it creates one or more asynchronous processing events based on the orchestration. These processing events get sent out to an event channel, which can either be a message queue or a message topic.
Message topics are more commonly used with the mediator topology due to the orchestration involved, which allows multiple event processors, which will perform different tasks, to receive an event message. This can be seen in the preceding diagram where some of the event channels are sending an event message to multiple event processors.
Event processors listen in on event channels to pick up events and process them in line with their design. In the Event processing styles section later in this chapter, we will cover the different processing styles typically used by event processors.