Skip to content

Available now

Test your consumer ​

Two ways to test a consumer, and a good integration uses both:

  • Test runs in the portal play the bus's own consumer scenarios into your workspace (duplicates, a late snapshot, unknown types, a newer minor version) and grade the end state your consumer reports. See Test runs.
  • Your own tests, below: publish with a producer app of your own and check your consumer's end state, what it stores or shows, not just what it logged. Two of them need a replay or a redrive, which you start yourself under Consumer connections in the portal.
TestDoYour consumer must end with
T1 Whole storyPublish the hurricane run, snapshots 1 to 7, then a KILLED snapshotSnapshot 7's content exactly, then the story shown as killed, or gone from live views
T2 ReplayReplay your connection from before T1The same end state as after T1. Nothing doubled
T3 Late older snapshotMake your handler fail on snapshot 3 until it reaches your dead-letter queue; let 4 to 7 through; fix it and redriveSnapshot 7 still current. Snapshot 3 dropped, not applied
T4 Unknown thingsPublish a snapshot with an extension com.othervendor.x, and, if your grants allow, a message type your consumer doesn't knowHandled normally, the unknown parts ignored. No error, nothing in the dead-letter queue
T5 Newer minor versionPublish a new story with the same snapshot content, som_version: "1.1.0" and one extra payload field (the same story again would be refused as stale)Exactly the same end state as the 1.0.0 story
T6 Poison messageMake your handler throw for one storyThat story's message reaches the dead-letter queue after the connection's attempt limit, other stories keep flowing, and you're alerted
T7 OutageStop your consumer, publish a story, start it againEverything arrives, in order

What each test checks is on Order, duplicates and snapshots.

Checkpoint ​

  • [ ] My consumer acknowledges a message only after handling it, with enough visibility for slow work (visibility on the pull API; ChangeMessageVisibility on the queue).
  • [ ] Every consumer scenario in a test run passes.
  • [ ] It keeps the highest sequence_number per story and applies snapshots as whole replacements.
  • [ ] It's idempotent on message_id, and ignores unknown types, extensions and fields.
  • [ ] T1 to T7 end in the expected state, and I'm alerted on my dead-letter queue.

SOM is an open standard maintained by the SOM working group. This service is not endorsed by it.