Samples
Overview
Section titled “Overview”Most patterns documented under Messaging Patterns have a runnable example under examples/ in the repo. Each example is a standalone tsx-powered script that publishes some messages and exits. A few patterns — competing consumers, content-based routing, and scatter-gather — don’t have their own example directory; they’re illustrated within other examples (for instance, scatter-gather is exercised inside the request-reply example via sendRequestMulti) and in the pattern docs themselves.
Layout
Section titled “Layout”examples/├── docker-compose.yml # RabbitMQ + MongoDB for examples that need them├── run-all.sh # runs every example in sequence├── lib/ # shared helpers (connection URLs, logging)├── publish-subscribe/├── send/├── request-reply/├── polymorphic/├── saga/├── aggregator/├── routing-slip/├── streaming/├── filters/└── telemetry/Running
Section titled “Running”cd examplesdocker compose up -dbash run-all.shEach example is also runnable individually:
cd examples/request-replynode --import tsx src/index.tsCatalogue
Section titled “Catalogue”| Example | Pattern page |
|---|---|
publish-subscribe | Pub/Sub |
send | Point-to-Point |
request-reply | Request/Reply |
polymorphic | Polymorphic Messages |
saga | Process Manager |
aggregator | Aggregator |
routing-slip | Routing Slip |
streaming | Streaming |
filters | Filters |
telemetry | Observability |