A Go library for building event-driven applications with message streams, supporting various pub/sub implementations.
Watermill is a Go library that simplifies building event-driven applications by providing tools to work efficiently with message streams. It solves the complexity of distributed systems communication, enabling patterns like event sourcing, CQRS, and sagas with a unified interface. Developers can use various pub/sub implementations such as Kafka, RabbitMQ, or even HTTP and SQL databases, making it versatile for different infrastructure needs.
Go developers building scalable, distributed services who need to implement event-driven architectures, message processing, or stream-based communication without deep expertise in low-level messaging protocols.
Watermill stands out by offering a simple, universal API that abstracts the intricacies of message brokers, combined with proven stability, extensive middleware support, and high performance. It lowers the barrier to entry for event-driven development while providing the flexibility needed for production systems.
Building event-driven applications the easy way in Go.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports Kafka, RabbitMQ, HTTP, PostgreSQL, and more through a unified interface, enabling flexibility in infrastructure choice without locking you into a single broker.
Based on a clean handler function signature (`func(*Message) ([]*Message, error)`), making it intuitive for developers familiar with Go's HTTP handlers and reducing boilerplate.
Includes comprehensive stress tests, race condition detection, and a stable API since v1.0.0, ensuring it's battle-tested for production environments.
Extensive middleware and plugin support for customizing behavior, such as metrics and resilience patterns, with many real-world examples provided.
The abstraction layer can reduce throughput compared to native broker clients, as benchmarks show GoChannel is significantly faster than broker-based Pub/Subs like RabbitMQ or Kafka.
Integrating with different Pub/Subs requires additional external libraries and configuration, which can be cumbersome and add to dependency management overhead.
Exclusively for Go, so it's not suitable for polyglot microservices architectures where other languages are involved, limiting its use in mixed-tech stacks.