Skip to content

Message schema

The shape every BabelQueue message follows.

Every BabelQueue message follows the same envelope, regardless of which language wrote it. A shared shape is what makes cross-language consumption possible.

Envelope

A message carries identifying metadata alongside its payload — for example an id, the message type, a timestamp, and the body itself:

<pre class="astro-code github-dark" style="background-color:#24292e;color:#e1e4e8; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;" tabindex="0" data-language="json"><code><span class="line"><span style="color:#E1E4E8">{</span></span> <span class="line"><span style="color:#79B8FF"> "id"</span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">"018f..."</span><span style="color:#E1E4E8">,</span></span> <span class="line"><span style="color:#79B8FF"> "type"</span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">"order.created"</span><span style="color:#E1E4E8">,</span></span> <span class="line"><span style="color:#79B8FF"> "occurredAt"</span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">"2026-07-24T10:00:00Z"</span><span style="color:#E1E4E8">,</span></span> <span class="line"><span style="color:#79B8FF"> "payload"</span><span style="color:#E1E4E8">: { }</span></span> <span class="line"><span style="color:#E1E4E8">}</span></span></code></pre>

Warning

The schema is strict — producers must emit exactly the agreed fields, and consumers should reject messages that don’t validate. That strictness is the whole point: it’s what lets six languages trust the same message.