Skip to content

Commit e805341

Browse files
committed
Update
1 parent fe33cc1 commit e805341

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

docs/content/learn/getting-started.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,22 @@ weight = 10
88

99
## What is Watermill?
1010

11-
Watermill is a Go library for working with messages.
11+
Watermill is a Go library for working with messages the easy way.
1212

13-
You can use it to build event-driven systems with Pub/Subs like Kafka, RabbitMQ, PostgreSQL, and many more.
13+
You can use it to build message-driven and event-driven applications with Pub/Subs like Kafka, RabbitMQ, PostgreSQL, and many more.
1414

1515
Watermill comes with batteries included. It gives you tools used by every message-driven application.
1616

1717
## Why use Watermill?
1818

19-
Except for trivial applications, synchronous communication (like HTTP) isn't enough.
19+
When you run an HTTP server, you don't deal directly with TCP sockets, parsing HTTP requests, or managing connections.
20+
Instead, you use a high-level library like `net/http` that handles all that complexity for you.
2021

21-
Using messages for asynchronous communication simplifies many problems, like scaling, reliability, and decoupling services.
22+
**It's what Watermill aims to be for messages**.
23+
It provides all you need to build an application based on events or other asynchronous patterns.
2224

23-
While there are tons of libraries for working with HTTP, correctly setting up a message-oriented project can be challenging.
2425
There are many different message queues, each with different features, client libraries, and APIs.
25-
26-
**Watermill aims to be the standard messaging library for Go**, hiding all that complexity behind an API that is easy to use and understand.
27-
It provides all you need to build an application based on events or other asynchronous patterns.
26+
Watermill hides all that complexity behind an API that is easy to use and understand.
2827

2928
**Watermill is NOT a framework**.
3029
It's a lightweight library that's easy to plug in or remove from your project.
@@ -51,9 +50,17 @@ The idea behind event-driven applications is always the same: one part publishes
5150

5251
Watermill supports this behavior for multiple [publishers and subscribers]({{< ref "/pubsubs" >}}).
5352

54-
The core part of Watermill is the [*Message*]({{< ref "/docs/message" >}}).
55-
It is what `http.Request` is for the `net/http` package.
56-
Most Watermill features work with this struct.
53+
### Three APIs
54+
55+
Watermill comes with three APIs for working with messages.
56+
They build on top of each other, each step providing a higher-level API.
57+
58+
In this guide, we're going to start from the bottom and move up.
59+
It's good to know the fundamentals, even if you're going to use the high-level APIs.
60+
61+
<div class="text-center">
62+
<img src="/img/pyramid.png" alt="Watermill components pyramid" style="width:35rem;" />
63+
</div>
5764

5865
## Publisher & Subscriber
5966

@@ -75,6 +82,10 @@ type Subscriber interface {
7582

7683
### Creating Messages
7784

85+
**The core part of Watermill is the [Message]({{< ref "/docs/message" >}}).**
86+
It is what `http.Request` is for the `net/http` package.
87+
Most Watermill features work with this struct.
88+
7889
Watermill doesn't enforce any message format. `NewMessage` expects a slice of bytes as the payload.
7990
You can use strings, JSON, protobuf, Avro, gob, or anything else that serializes to `[]byte`.
8091

@@ -298,19 +309,6 @@ A more detailed explanation of how it is working (and how to add live code reloa
298309

299310
{{< /tabs >}}
300311

301-
## Three APIs
302-
303-
Watermill comes with three APIs for working with messages.
304-
They build on top of each other, each step providing a higher-level API:
305-
306-
* At the bottom, the `Publisher` and `Subscriber` interfaces. It's the "raw" way of working with messages. You get full control, but also need to handle everything yourself.
307-
* The `Router` is similar to HTTP routers you probably know. It introduces message handlers, saving you some boilerplate.
308-
* The `CQRS` component adds generic handlers without needing to marshal and unmarshal messages yourself.
309-
310-
<div class="text-center">
311-
<img src="/img/pyramid.png" alt="Watermill components pyramid" style="width:35rem;" />
312-
</div>
313-
314312
## Router
315313

316314
[*Publishers and subscribers*]({{< ref "/docs/pub-sub" >}}) are the low-level parts of Watermill.
@@ -373,6 +371,8 @@ See the [CQRS component](/docs/cqrs) for the generic high-level API.
373371

374372
For more details, see [documentation topics]({{< ref "/docs" >}}).
375373

374+
[The Outbox Pattern](/advanced/forwarder/) is a key pattern to know in event-driven applications.
375+
376376
We recommend checking the examples below to see how Watermill works in practice.
377377
You can also try the [free hands-on training]({{< ref "/learn/quickstart/" >}}) to learn how to use Watermill in practice.
378378

0 commit comments

Comments
 (0)