Watermill is a Go library for building event-driven applications using message streams.
The library addresses the complexity of distributed systems by providing a unified abstraction over message brokers and transports. Rather than requiring developers to master the intricacies of each messaging system, Watermill offers a consistent API that works with conventional pub/sub implementations like Kafka and RabbitMQ, but also supports HTTP and PostgreSQL as transport layers. This flexibility lets teams choose the right tool for their use case without rewriting application logic. The library handles concerns like at-least-once delivery guarantees, message ordering, and asynchronous processing patterns through its router and middleware system.
Watermill suits teams building event-sourced systems, CQRS architectures, sagas, or stream-processing applications in Go. It is particularly valuable when you need to support multiple messaging transports or want to avoid tight coupling to a specific broker. The library emphasizes ease of understanding and provides extensive examples covering basic usage, real-world patterns like webhook handling and database synchronization, and complete reference projects. Developers should expect to learn event-driven concepts alongside the library itself, as the project includes training materials on industry-standard patterns.
The project maintains active development with regular updates to its core functionality and examples. The codebase includes comprehensive stress tests and benchmarks demonstrating performance characteristics. Documentation is extensive, spanning quickstart guides, detailed API references, and real-world example implementations. The project demonstrates responsiveness to practical use cases through its growing collection of example applications and patterns.