From f597c034fca7ac660c3cd29e4ed42d82db463489 Mon Sep 17 00:00:00 2001 From: boreq Date: Fri, 19 Nov 2021 14:22:38 +0100 Subject: [PATCH 1/2] Add watermill-bolt to the list of pubsubs --- docs/build.sh | 1 + docs/content/pubsubs/bolt.md | 73 ++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 docs/content/pubsubs/bolt.md diff --git a/docs/build.sh b/docs/build.sh index 524ec2e18..728c50530 100755 --- a/docs/build.sh +++ b/docs/build.sh @@ -73,6 +73,7 @@ cloneOrPull "https://github.com/ThreeDotsLabs/watermill-kafka.git" content/src-l cloneOrPull "https://github.com/ThreeDotsLabs/watermill-nats.git" content/src-link/watermill-nats cloneOrPull "https://github.com/ThreeDotsLabs/watermill-sql.git" content/src-link/watermill-sql cloneOrPull "https://github.com/ThreeDotsLabs/watermill-firestore.git" content/src-link/watermill-firestore +cloneOrPull "https://github.com/ThreeDotsLabs/watermill-bolt.git" content/src-link/watermill-bolt python3 ./extract_middleware_godocs.py > content/src-link/middleware-defs.md diff --git a/docs/content/pubsubs/bolt.md b/docs/content/pubsubs/bolt.md new file mode 100644 index 000000000..02eb3f0e6 --- /dev/null +++ b/docs/content/pubsubs/bolt.md @@ -0,0 +1,73 @@ ++++ +title = "Bolt Pub/Sub" +description = "A pure Go key/value store" +date = 2021-11-19T00:00:00+02:00 +bref = "A pure Go key/value store" +weight = 0 +type = "docs" +toc = false ++++ + +### Bolt Pub/Sub + +Bolt is a pure Go key/value store which provides a simple, fast, and reliable +database for projects that don't require a full database server such as +Postgres or MySQL. + +Bolt backed Pub/Sub is good for simple applications which don't need a more +advanced Pub/Sub system with external dependencies or already use Bolt and +want to publish messages in transaction when saving other data. + +Bolt documentation: https://github.com/etcd-io/bbolt + +#### Characteristics + +| Feature | Implements | Note | +| ------------------- | ---------- | ---- | +| ConsumerGroups | no | | +| ExactlyOnceDelivery | no | | +| GuaranteedOrder | no | | +| Persistent | yes | | + +#### Configuration + +{{% render-md %}} +{{% load-snippet-partial file="src-link/watermill-bolt/pkg/bolt/bolt.go" first_line_contains="type CommonConfig struct " last_line_equals="}" %}} +{{% /render-md %}} + +{{% render-md %}} +{{% load-snippet-partial file="src-link/watermill-bolt/pkg/bolt/bolt.go" first_line_contains="type PublisherConfig struct " last_line_equals="}" %}} +{{% /render-md %}} + +{{% render-md %}} +{{% load-snippet-partial file="src-link/watermill-bolt/pkg/bolt/bolt.go" first_line_contains="type SubscriberConfig struct " last_line_equals="}" %}} +{{% /render-md %}} + +##### Subscription name + +To receive messages published to a topic, you must create a subscription to +that topic. Only messages published to the topic after the subscription is +created will be received by the subscriber. + +A topic can have multiple subscriptions, but a given subscription belongs to +a single topic. + +In Watermill, the subscription is created automatically during calling +`Subscribe()`. Subscription name is generated by calling the function set as +`SubscriberConfig.GenerateSubscriptionName`. By default, it is the topic name +with the string `_sub` appended to it. + +##### Marshaler + +Watermill's messages cannot be directly saved in Bolt which operates on byte +slices. Marshaller converts the messages to and from byte slices. The default +implementation marshals messages as JSON, a format which is human-readable +for easier debugging. The performance should be enough for most applications +unless a very large messages are used within your system. If that is the case +you may want to consider implementing a more efficient marshaler. + +{{% render-md %}} +{{% load-snippet-partial file="src-link/watermill-bolt/pkg/bolt/marshaler.go" first_line_contains="// Marshaler" last_line_equals="}" %}} +{{% /render-md %}} + + From a2aecdc0379148744c247391af8f00f3961de531 Mon Sep 17 00:00:00 2001 From: boreq Date: Fri, 19 Nov 2021 15:37:02 +0100 Subject: [PATCH 2/2] Trigger Build