docs/content/development/pub-sub-implementing.md
+++ title = "Implementing a new Pub/Sub" description = "Bring Your Own Pub/Sub" date = 2018-12-05T12:48:34+01:00 weight = 200 draft = false bref = "Bring Your Own Pub/Sub" +++
To add support for a custom Pub/Sub, you have to implement both message.Publisher and message.Subscriber interfaces.
{{% load-snippet-partial file="src-link/message/pubsub.go" first_line_contains="type Publisher interface" last_line_contains="type SubscribeInitializer" padding_after="0" %}}
Watermill provides a set of test scenarios that any Pub/Sub implementation can use. Each test suite needs to declare what features it supports and how to construct a new Pub/Sub. These scenarios check both basic usage and more uncommon use cases. Stress tests are also included.
Here are a few things you shouldn't forget about:
Close() implementation for the publisher and subscriber that is:
Ack() and Nack() support for consumed messages.Nack() for a consumed message.We will also be thankful for submitting a pull requests with the new Pub/Sub implementation.
If anything is not clear, feel free to use any of our [support channels]({{< ref "/support" >}}) to reach us, we will be glad to help.