[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-5076":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":23,"hasPages":23,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":38,"readmeContent":39,"aiSummary":40,"trendingCount":16,"starSnapshotCount":16,"syncStatus":41,"lastSyncTime":42,"discoverSource":43},5076,"watermill","ThreeDotsLabs\u002Fwatermill","ThreeDotsLabs","Building event-driven applications the easy way in Go.","https:\u002F\u002Fwatermill.io",null,"Go",9750,497,85,75,0,1,7,50,4,74.59,"MIT License",false,"master",[26,27,28,29,30,31,32,33,34,35,36,37,5],"cqrs","event-driven","event-sourcing","events","go","golang","kafka","nats","rabbitmq","reactive","sagas","stream-processing","2026-06-12 04:00:24","# Watermill\n\u003Cimg align=\"right\" width=\"300\" src=\"https:\u002F\u002Fwatermill.io\u002Fimg\u002Fgopher.svg\">\n\n[![CI Status](https:\u002F\u002Fgithub.com\u002FThreeDotsLabs\u002Fwatermill\u002Factions\u002Fworkflows\u002Fmaster.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002FThreeDotsLabs\u002Fwatermill\u002Factions\u002Fworkflows\u002Fmaster.yml)\n[![Go Reference](https:\u002F\u002Fpkg.go.dev\u002Fbadge\u002Fgithub.com\u002FThreeDotsLabs\u002Fwatermill.svg)](https:\u002F\u002Fpkg.go.dev\u002Fgithub.com\u002FThreeDotsLabs\u002Fwatermill)\n[![Go Report Card](https:\u002F\u002Fgoreportcard.com\u002Fbadge\u002Fgithub.com\u002FThreeDotsLabs\u002Fwatermill)](https:\u002F\u002Fgoreportcard.com\u002Freport\u002Fgithub.com\u002FThreeDotsLabs\u002Fwatermill)\n[![codecov](https:\u002F\u002Fcodecov.io\u002Fgh\u002FThreeDotsLabs\u002Fwatermill\u002Fbranch\u002Fmaster\u002Fgraph\u002Fbadge.svg)](https:\u002F\u002Fcodecov.io\u002Fgh\u002FThreeDotsLabs\u002Fwatermill)\n\nWatermill is a Go library for working efficiently with message streams. It is intended\nfor building event driven applications, enabling event sourcing, RPC over messages,\nsagas and basically whatever else comes to your mind. You can use conventional pub\u002Fsub\nimplementations like Kafka or RabbitMQ, but also HTTP or PostgreSQL if that fits your use case.\n\n## Goals\n\n* **Easy** to understand.\n* **Universal** - event-driven architecture, messaging, stream processing, CQRS - use it for whatever you need.\n* **Fast** (see [Benchmarks](#benchmarks)).\n* **Flexible** with middlewares, plugins and Pub\u002FSub configurations.\n* **Resilient** - using proven technologies and passing stress tests (see [Stability](#stability)).\n\n## Getting Started\n\nPick what you like the best or see in order:\n\n1. [Quickstart](https:\u002F\u002Fwatermill.io\u002Flearn\u002Fquickstart\u002F) — learn by coding!\n2. Follow the [Getting Started guide](https:\u002F\u002Fwatermill.io\u002Flearn\u002Fgetting-started\u002F).\n3. See examples below.\n4. Read the full documentation: https:\u002F\u002Fwatermill.io\u002F\n\n## Our online hands-on training\n\nGo Event-Driven goes beyond Watermill Quickstart. You'll learn industry standard concepts and patterns like:\n\n* Handling at-least-once delivery\n* Asynchronous read models\n* Events & Commands\n* Observability\n* Message ordering\n* Sagas\n\n\u003Ca href=\"https:\u002F\u002Fthreedots.tech\u002Fevent-driven\u002F?utm_source=watermill-readme\">\u003Cimg align=\"center\" width=\"400\" src=\"https:\u002F\u002Fthreedots.tech\u002Fevent-driven-banner.png\">\u003C\u002Fa>\n\n## Examples\n\n* Basic\n    * [Your first app](_examples\u002Fbasic\u002F1-your-first-app) - **start here!**\n    * [Realtime feed](_examples\u002Fbasic\u002F2-realtime-feed)\n    * [Router](_examples\u002Fbasic\u002F3-router)\n    * [Metrics](_examples\u002Fbasic\u002F4-metrics)\n    * [CQRS with protobuf](_examples\u002Fbasic\u002F5-cqrs-protobuf)\n* [Pub\u002FSubs usage](_examples\u002Fpubsubs)\n    * These examples are part of the [Getting started guide](https:\u002F\u002Fwatermill.io\u002Flearn\u002Fgetting-started\u002F) and show usage of a single Pub\u002FSub at a time.\n* Real-world examples\n    * [Exactly-once delivery counter](_examples\u002Freal-world-examples\u002Fexactly-once-delivery-counter)\n    * [Receiving webhooks](_examples\u002Freal-world-examples\u002Freceiving-webhooks)\n    * [Sending webhooks](_examples\u002Freal-world-examples\u002Fsending-webhooks)\n    * [Synchronizing Databases](_examples\u002Freal-world-examples\u002Fsynchronizing-databases)\n    * [Persistent Event Log](_examples\u002Freal-world-examples\u002Fpersistent-event-log)\n    * [Transactional Events](_examples\u002Freal-world-examples\u002Ftransactional-events)\n    * [Real-time HTTP updates with Server-Sent Events](_examples\u002Freal-world-examples\u002Fserver-sent-events)\n    * [Real-time HTTP updates with Server-Sent Events and htmx](_examples\u002Freal-world-examples\u002Fserver-sent-events-htmx)\n* Complete projects\n    * [NATS example with live code reloading](https:\u002F\u002Fgithub.com\u002FThreeDotsLabs\u002Fnats-example)\n    * [RabbitMQ, webhooks and Kafka integration](https:\u002F\u002Fgithub.com\u002FThreeDotsLabs\u002Fevent-driven-example)\n\n## Background\n\nBuilding distributed and scalable services is rarely as easy as some may suggest. There is a\nlot of hidden knowledge that comes with writing such systems. Just like you don't need to know the\nwhole TCP stack to create a HTTP REST server, you shouldn't need to study all of this knowledge to\nstart with building message-driven applications.\n\nWatermill's goal is to make communication with messages as easy to use as HTTP routers. It provides\nthe tools needed to begin working with event-driven architecture and allows you to learn the details\non the go.\n\nAt the heart of Watermill there is one simple interface:\n```go\nfunc(*Message) ([]*Message, error)\n```\n\nYour handler receives a message and decides whether to publish new message(s) or return\nan error. What happens next is up to the middlewares you've chosen.\n\nYou can find more about our motivations in our [*Introducing Watermill* blog post](https:\u002F\u002Fthreedots.tech\u002Fpost\u002Fintroducing-watermill\u002F).\n\n## Pub\u002FSubs\n\nAll publishers and subscribers have to implement an interface:\n\n```go\ntype Publisher interface {\n\tPublish(topic string, messages ...*Message) error\n\tClose() error\n}\n\ntype Subscriber interface {\n\tSubscribe(ctx context.Context, topic string) (\u003C-chan *Message, error)\n\tClose() error\n}\n```\n\nSupported Pub\u002FSubs:\n\n- AMQP (RabbitMQ) Pub\u002FSub [(`github.com\u002FThreeDotsLabs\u002Fwatermill-amqp\u002Fv3`)](https:\u002F\u002Fgithub.com\u002FThreeDotsLabs\u002Fwatermill-amqp\u002F)\n- AWS SNS\u002FSQS Pub\u002FSub [(`github.com\u002FThreeDotsLabs\u002Fwatermill-aws`)](https:\u002F\u002Fgithub.com\u002FThreeDotsLabs\u002Fwatermill-aws\u002F)\n- Bolt Pub\u002FSub [(`github.com\u002FThreeDotsLabs\u002Fwatermill-bolt`)](https:\u002F\u002Fgithub.com\u002FThreeDotsLabs\u002Fwatermill-bolt\u002F)\n- Firestore Pub\u002FSub [(`github.com\u002FThreeDotsLabs\u002Fwatermill-firestore`)](https:\u002F\u002Fgithub.com\u002FThreeDotsLabs\u002Fwatermill-firestore\u002F)\n- Google Cloud Pub\u002FSub [(`github.com\u002FThreeDotsLabs\u002Fwatermill-googlecloud\u002Fv2`)](https:\u002F\u002Fgithub.com\u002FThreeDotsLabs\u002Fwatermill-googlecloud\u002F)\n- HTTP Pub\u002FSub [(`github.com\u002FThreeDotsLabs\u002Fwatermill-http\u002Fv2`)](https:\u002F\u002Fgithub.com\u002FThreeDotsLabs\u002Fwatermill-http\u002F)\n- io.Reader\u002Fio.Writer Pub\u002FSub [(`github.com\u002FThreeDotsLabs\u002Fwatermill-io`)](https:\u002F\u002Fgithub.com\u002FThreeDotsLabs\u002Fwatermill-io\u002F)\n- Kafka Pub\u002FSub [(`github.com\u002FThreeDotsLabs\u002Fwatermill-kafka\u002Fv3`)](https:\u002F\u002Fgithub.com\u002FThreeDotsLabs\u002Fwatermill-kafka\u002F)\n- NATS Jetstream Pub\u002FSub [(`github.com\u002FThreeDotsLabs\u002Fwatermill-nats\u002Fv2`)](https:\u002F\u002Fgithub.com\u002FThreeDotsLabs\u002Fwatermill-nats\u002F)\n- Redis Stream Pub\u002FSub [(`github.com\u002FThreeDotsLabs\u002Fwatermill-redisstream`)](https:\u002F\u002Fgithub.com\u002FThreeDotsLabs\u002Fwatermill-redisstream\u002F)\n- SQL (MySQL \u002F PostgreSQL) Pub\u002FSub [(`github.com\u002FThreeDotsLabs\u002Fwatermill-sql\u002Fv4`)](https:\u002F\u002Fgithub.com\u002FThreeDotsLabs\u002Fwatermill-sql\u002F)\n- SQLite Pub\u002FSub (Beta) [(`github.com\u002FThreeDotsLabs\u002Fwatermill-sqlite\u002F`)](https:\u002F\u002Fgithub.com\u002FThreeDotsLabs\u002Fwatermill-sqlite\u002F)\n\nAll Pub\u002FSubs implementation documentation can be found in the [documentation](https:\u002F\u002Fwatermill.io\u002Fpubsubs\u002F).\n\n## Unofficial libraries\n\nCan't find your favorite Pub\u002FSub or library integration? Check [Awesome Watermill](https:\u002F\u002Fwatermill.io\u002Fdocs\u002Fawesome\u002F).\n\nIf you know another library or are an author of one, please [add it to the list](https:\u002F\u002Fgithub.com\u002FThreeDotsLabs\u002Fwatermill\u002Fedit\u002Fmaster\u002Fdocs\u002Fcontent\u002Fdocs\u002Fawesome.md).\n\n## Contributing\n\nPlease check our [contributing guide](CONTRIBUTING.md).\n\n## Stability\n\nWatermill v1.0.0 has been released and is production-ready. The public API is stable and will not change without changing the major version.\n\nTo ensure that all Pub\u002FSubs are stable and safe to use in production, we created a [set of tests](https:\u002F\u002Fgithub.com\u002FThreeDotsLabs\u002Fwatermill\u002Fblob\u002Fmaster\u002Fpubsub\u002Ftests\u002Ftest_pubsub.go#L34) that need to pass for each of the implementations before merging to master.\nAll tests are also executed in [*stress*](https:\u002F\u002Fgithub.com\u002FThreeDotsLabs\u002Fwatermill\u002Fblob\u002Fmaster\u002Fpubsub\u002Ftests\u002Ftest_pubsub.go#L171) mode - that means that we are running all the tests **20x** in parallel.\n\nAll tests are run with the race condition detector enabled (`-race` flag in tests).\n\nFor more information about debugging tests, you should check [tests troubleshooting guide](http:\u002F\u002Fwatermill.io\u002Fdocs\u002Ftroubleshooting\u002F#debugging-pubsub-tests).\n\n## Benchmarks\n\nInitial tools for benchmarking Pub\u002FSubs can be found in [watermill-benchmark](https:\u002F\u002Fgithub.com\u002FThreeDotsLabs\u002Fwatermill-benchmark).\n\nAll benchmarks are being done on a single 16 CPU VM instance, running one binary and dependencies in Docker Compose.\n\nThese numbers are meant to serve as a rough estimate of how fast messages can be processed by different Pub\u002FSubs.\nKeep in mind that the results can be vastly different, depending on the setup and configuration (both much lower and higher).\n\nHere's the short version for message size of 16 bytes.\n\n| Pub\u002FSub                         | Publish (messages \u002F s) | Subscribe (messages \u002F s) |\n|---------------------------------|------------------------|--------------------------|\n| GoChannel                       | 315,776                | 138,743                  |\n| Redis Streams                   | 59,158                 | 12,134                   |\n| NATS Jetstream (16 Subscribers) | 50,668                 | 34,713                   |\n| Kafka (one node)                | 41,492                 | 101,669                  |\n| SQL (MySQL, batch size=100)     | 6,371                  | 2,794                    |\n| SQL (PostgreSQL, batch size=1)  | 2,831                  | 9,460                    |\n| Google Cloud Pub\u002FSub            | 3,027                  | 28,589                   |\n| AMQP (RabbitMQ)                 | 2,770                  | 14,604                   |\n\n## Support\n\nIf you didn't find the answer to your question in [the documentation](https:\u002F\u002Fwatermill.io\u002F), feel free to ask us directly!\n\nPlease join us on the `#watermill` channel on the [Three Dots Labs Discord](https:\u002F\u002Fdiscord.gg\u002FQV6VFg4YQE).\n\n## Why the name?\n\nIt processes streams!\n\n## License\n\n[MIT License](.\u002FLICENSE)\n","Watermill 是一个用于构建事件驱动应用的 Go 语言库。它支持事件溯源、基于消息的 RPC、Saga 模式以及流处理等核心功能，并且可以与 Kafka、RabbitMQ 等多种消息中间件集成，同时也兼容 HTTP 和 PostgreSQL 等其他传输方式。该库设计目标是易于理解、高度灵活可配置，并且具有良好的性能和稳定性。Watermill 非常适合需要实现复杂业务逻辑解耦、异步处理或分布式事务管理的应用场景，特别是在微服务架构中能够发挥重要作用。",2,"2026-06-11 03:02:24","top_language"]