Examples Overview
Hoppity ships with example projects in the examples/ directory. Each demonstrates a different messaging pattern. All examples work with the docker-compose.yml at the repo root for RabbitMQ.
Prerequisites
Section titled “Prerequisites”All examples require:
- Node.js 22+
- pnpm 9+
- Docker (for RabbitMQ)
Pattern Comparison
Section titled “Pattern Comparison”| Pattern | Example | When to Use |
|---|---|---|
| Pub/Sub | basic-pubsub | Simple event broadcasting with raw topology escape hatch |
| Contract-Driven | bookstore | Multiple services with shared domain contracts, typed messaging |
Basic Pub/Sub Publisher sends to exchange, subscriber consumes from queue.
Bookstore Full contract-driven multi-service demo with events, RPC, and middleware.