Reading a Stream’s Messages
Now let’s get the messages in a particular stream. We’re going to support three classes of streams, namely, entity, category, and the $all stream. As a refresher, entity streams are usually named something like identity-721304b9-8ece-4c1c-aaed-efad4886023d—a category followed by a UUID. The events in this example entity stream are also in the identity category stream. $all is a stream containing every message in the store.
Eventide provides us with functions for entity and category streams. We’ll write our own query for the $all stream when we get to Chapter 13, Debugging Components.
Stream Type | SQL Snippet |
|---|---|
Category | SELECT * FROM get_category_messages($1, $2, $3) |
Non-category | SELECT * FROM get_stream_messages($1, $2, ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access