Event-Driven Architecture (EDA) is used in distributed systems to loosely couple applications. Instead of applications communicating directly with each other, they connect to a message broker and publish or consume events independently.

However, loose coupling introduces a challenge that is often overlooked:

How do you know your business process is actually working?

The Monitoring Gap in EDA

In a traditional point-to-point design, the publisher can trigger an alert

· if it cannot connect to the subscriber or

· if the consumer does not acknowledge the request.

The communication path is direct, so failures are usually visible.


EDA works differently.

Applications connect to the message bus, not directly to each other, and the application disconnections are also normal scenarios, and the broker will store messages in the queue, so no messages are lost.

From the broker's perspective, everything is operating as designed.

The problem is that the business process may already be stalled.

This makes monitoring one of the biggest operational challenges in EDA.


Loose Coupling Does Not Mean Zero Monitoring

One of the major benefits of EDA is loose coupling, as "systems do not need to know about each other."

From a design perspective, that's correct. From an operational perspective, it can be dangerous.

Example 1: Fan-Out Control Messages

If an upstream system fans out a control message to multiple downstream systems, it should know the status of each client to ensure data is synchronized across all systems. For example, a backend system sends a stop-sell or start-sell event to channel servers in different regions, and we need to ensure the event is successfully processed by all channel servers. Otherwise, it may impact business outcomes.

Example 2: Stuck Consumer Instances

Multiple application instances may subscribe to messages from the same non-exclusive queue. If one of the instances crashes for any reason but does not exit properly, it may subscribe to messages without processing or acknowledging them to the broker. These messages can remain on the queue for a long time, causing message processing delays and wasting computing resources without doing any useful work.

Monitoring Approach #1: Using APM for Multi-Factor Alerting

Most brokers provide statistics at the VPN, queue, and client levels, and allow you to configure thresholds to trigger alerts. However, these alerts are usually based on fixed values and a single factor, making it difficult to meet flexible application requirements that depend on multiple factors. For example, a critical control message queue should trigger an alert when there are more than five spooled messages, and no client is bound to the queue.


We can collect VPN, queue, broker, and client statistics through the management port every minute, and then use APM tools to generate alerts based on multiple conditions. For example, if a queue has more than five spooled messages and no client is bound to it, an alert can be triggered and sent to the corresponding team via email, Microsoft Teams, or WhatsApp if the condition occurs three times within ten minutes.

Monitoring Approach #2: Application Metrics

Applications should expose metrics for message publishing and consumption rates per second or per minute. If these numbers suddenly drop, an alert should be triggered for the operations or development team to investigate. In some cases, this may be a false alert.


Monitoring Approach #3: Heartbeat Events

The two monitoring approaches above focus on individual components rather than end-to-end message flow. How can we monitor the complete publisher-to-consumer flow?


Solution 1

Establish a separate service that publishes heartbeat messages to a specific topic every five seconds, and have all queues subscribe to that topic. If a consumer does not receive a heartbeat within five seconds, it means something may be wrong, and an alert should be triggered.

This solution is very simple, but it introduces additional traffic for heartbeat events, and consumers may experience performance impacts during traffic peaks.


Solution 2

Each publisher sends a heartbeat event only when no messages have been published during the previous five seconds. Consumers process normal messages as usual and simply ignore heartbeat events.

This solution provides end-to-end monitoring and does not impact consumer performance during peak traffic periods.


Final Thoughts

EDA is a distributed architecture designed to loosely couple systems, but end-to-end process monitoring remains a significant challenge.

Successfully publishing an event does not mean the business process completed successfully.


Organizations typically adopt a combination of monitoring approaches:

· Use APM tools to monitor broker and application health.

· Monitor VPN, queue, broker, and client statistics to detect consumer issues.

· Use heartbeat events to validate end-to-end message flows.


There is no universal solution. The right approach depends on your business requirements, operational risk tolerance, and monitoring budget.


One thing is certain: The more loosely coupled your architecture becomes, the more important observability becomes.


How does your organization monitor event flow health in a large-scale EDA environment? Do you rely on broker metrics, application metrics, heartbeat messages, or a combination of all three? Share your experience in the comments.