Now accepting guest editorial from SAP, Oracle, Workday and ServiceNow practitioners.Pitch a guide
The Sign-Off Table

Lesson 6 of 6

Testing and monitoring asynchronous flows

10 min

Listen to this lesson

0:00 / 15:30

The business events course gave consumer teams their test catalog: duplicates, out-of-order events, outages, poison messages. This lesson adds the tests the integration layer owes them: that the broker routes exactly what it should, that dead message queues catch what they should, that replay and ordering features behave as designed, and that monitoring raises the alarm before a backlog becomes a business problem. Priya's rule: the integration layer is proven before consumer teams test against it.

The integration-layer test catalog

TestHowExpected result
Positive routingPublish one event per subscribed topic in the test stageEach arrives in every queue that subscribes, once
Negative routingPublish 1910 events and unrelated topicsNothing arrives in queues that must not receive them
Wrong stageCreate an order in CMQ (and in CMR after each copy)No event in development or production brokers
DMQ routingConsumer rejects a crafted event until max redeliveryEvent lands in that queue's DMQ; alert raised
BacklogStop the consumer; publish 500 events; restartQueue holds all 500 within quota; drains; none lost
Ordering (partitioned)Publish Created then Changed for the same key under loadSame consumer instance gets both, in order
ReplayReplay from a time after a simulated bug fixExpected events redelivered; consumer handles duplicates
TTLLeave an event beyond its time to liveEvent leaves the queue as configured (DMQ or discard)

Tests the integration team runs before consumer teams start. Replay and partitioned queues apply where advanced event mesh is used.

The DMQ routing test traces one poison event from first delivery to the dead message queue, the alert and the planned republish.
The Sign-Off Table · thesignofftable.com/academy/sap-int-206

Replay: powerful and dangerous

In advanced event mesh, replay redelivers persistent messages from a replay log to a queue or topic endpoint: all messages, messages after a given message ID, or messages from a start time. SAP's documentation describes replay for non-partitioned queues and topic endpoints, and practitioners note that initiating replay on a queue removes messages already waiting in it to preserve order. That makes replay a planned operation, not a button to press in an incident: the consumer must be idempotent, the replay window must be agreed, and the queue's current contents must be understood. Contoso rehearses every replay in the test stage first.

A rehearsed replay: agreed start time, idempotent consumer, and a reference count to prove the reprocessing was complete and correct.
The Sign-Off Table · thesignofftable.com/academy/sap-int-206

Duplicates and ordering at the integration layer

Duplicates are not only a consumer problem. Replay produces them on purpose, a publisher retry after a timeout can produce them, and a consumer that crashes before acknowledging gets the same event again. The integration-layer test for duplicates is therefore simple: replay or republish a known event and confirm that the consumer's business effect happens once, checked in the target system, not in the consumer's log. Ordering is similar: where a partitioned queue promises order per key, Priya publishes Created and Changed for the same agreement under load with several consumer instances running, and checks that one instance processed both, in order.

Monitoring that catches problems early

SignalWhy it mattersContoso threshold (illustrative)
Queue depthConsumer slower than producers, or stoppedAlert at 1,000 messages or 50% of quota
Age of oldest messageBacklog is growing even if depth looks smallAlert at 15 minutes for the fleet notifier
DMQ depthPoison messages need a personAlert on any message
Publish failures in S/4HANAChannel or credentials brokenAlert on any failure in the event monitor
SilenceNo events where events are expectedAlert if no SalesOrder events in 2 business hours

Monitoring signals for Contoso's event flows. Advanced event mesh offers Insights dashboards; the Event Mesh capability has its own queue views; SAP Cloud ALM can collect alerts.

The last signal is the one teams forget. A broken outbound binding produces no errors and no backlog, only silence. Contoso's monitoring knows that order-to-cash publishes SalesOrder events every few minutes on a business day and alerts when it does not.

  1. Day 1WiringChannel and binding check; wrong-stage test
  2. Day 1RoutingPositive and negative routing for every queue
  3. Day 2Failure pathsDMQ routing, TTL, backlog with consumer stopped
  4. Day 3Advanced featuresOrdering per key and replay rehearsal, where used
  5. Day 3MonitoringTest alert for each signal reaches its team
The order in which Priya runs integration-layer tests for a release.
The Sign-Off Table · thesignofftable.com/academy/sap-int-206

Evidence for sign-off

  • For each test in the catalog: date, stage, event ids, timestamps and result.
  • For replay: the agreed window, the reference count and the consumer's recomputed totals.
  • For monitoring: a triggered test alert for each signal, received by the right team.
  • For the landscape: the stage pairing record and the latest wrong-stage test.

What goes wrong in testing

  • Happy path only. Every event arrives in the demo; DMQs are never exercised until production.
  • Untested alerts. Alerts are configured but go to an old distribution list.
  • Improvised replay. Replay in production during an incident deletes queued messages nobody expected to lose.
  • Silence ignored. No events means "all quiet" to everyone, until month-end.

What would you do?

On a Tuesday afternoon the fleet portal stops showing order changes. No alerts have fired: queue depth is zero and the DMQ is empty. What should Theo check first?

Key points
  • Test routing both ways: what must arrive and what must not.
  • Exercise every DMQ, and test alerts end to end before go-live.
  • Replay is a planned, rehearsed operation that needs idempotent consumers and an agreed window.
  • Monitor depth, oldest-message age, DMQ depth, publish failures and silence.

Check your understanding · not graded

Lesson check

  1. 1. Which test proves that a queue does not receive events meant for 1910?

  2. 2. According to SAP's documentation, which endpoints support message replay?

  3. 3. Why must replay be rehearsed before it is used in production?

  4. 4. Queue depth is zero and the DMQ is empty, but no updates arrive. Which signal catches this?

  5. 5. What proves an alert works?