Messaging and events
Kafka event → validate → publish
Consume a fixture record, parse and validate its JSON, publish a normalized event and explicitly commit the consumed record.
Last verified 2026-10-31 at f4ce7d0 — simulation fixtures
Studio activation is a one-time payment of USD 20.
Flow
Drawn at build time from the node positions in the template's process definitions. Numbered markers are the walkthrough stages.
Scroll sideways to see the whole flow.
List the 7 activities and 6 transitions
Activities
- Start
start - Consume order event
kafka.consume - Parse JSON
json.parse - Validate event
json.validate - Publish normalized event
kafka.publish - Commit offset
kafka.commit - End
end
Transitions
- Start → Consume order event (on success)
- Consume order event → Parse JSON (on success)
- Parse JSON → Validate event (on success)
- Validate event → Publish normalized event (on success)
- Publish normalized event → Commit offset (on success)
- Commit offset → End (on success)
Walkthrough
- Consume a recordThe in-memory fixture acts as an incoming raw event.
- Validate event JSONEnforce an ID and a non-negative numeric total.
- Publish normalized dataInspect the producer body and key in the trace.
- Commit after successExplicitly commit the consumed receipt.
What you will practise
- Track consume, publish and commit as separate activities.
- Test that invalid data does not reach publication or commit.
Sample cases
2 cases with 9 assertions, run with python -m server.integration examples --all in simulation.
Valid event
PassedA valid order event is published and committed.
Expected result A simulated send result and no uncommitted receipt.
4/4 assertions
- Process completes in simulation
- Publisher reports a simulated send
- Commit executed
- No unconfirmed message remains
This sample run only; not a production certification.
Invalid event total
Expected failure verifiedA negative total is rejected by JSON Schema.
Expected result Validation fails; publication and commit are skipped, leaving one unconfirmed receipt.
5/5 assertions
- Expected failure is recorded
- Schema rejection is visible
- No event is published
- No offset is committed
- Failed message remains unconfirmed
This sample run only; not a production certification.
Prerequisites
- Runtime
- Cohuno runtime 1.27.0, the version recorded when these cases last passed.
- Starter
- Manual start; no listener.
- Optional dependencies
- The optional Kafka driver (requirements-kafka.txt) needed only for live connections; simulation uses fixtures
- Simulation fixtures
demo_kafkakafka · kafka.consume, kafka.publish, kafka.commit
Verification details
Provenance
What was verified, and when. The content part changes whenever the pack, a process in its closure, the runtime version or a case result changes; the gallery check then fails until the gallery is regenerated and the changed templates are verified again.
Verified content
- Pack SHA-256
0d3e7c07292f4a44484c9c743ddb1724d57db4b18f6641e3b7d045e19d4d8e88- Closure SHA-256
23a28591e8d79d7af9caa67e36616937de09244a21308b1cd0f01b6959f56572- Runtime
1.27.0- Results
- 2/2 cases, 9/9 assertions, mode simulate, external calls: none.
- Files in the closure
server/integration/example_packs/kafka_events.jsonserver/integration/templates/kafka_order_pipeline.json
Verification event
- Commit
f4ce7d08eedc90267b405ed1974344153a8b3a34- Verified at (UTC)
2026-10-31T21:19:21Z
How the Cohuno team reproduces this check
PYTHONPATH=. python -m server.integration examples --example kafka_events PYTHONPATH=. python scripts/export_public_gallery.py --check