Skip to content

Commit

Permalink
update: README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
amirhnajafiz committed Jan 6, 2024
1 parent b6d3618 commit 979ff1a
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
# JetStream Mirroring using Benthos
# JetStream Mirroring

Mirroring our NATS (JetStream) cluster from different
regions to each other by using __Benthos__.
In this repository I mirrored one stream inside a JetStream service to another stream inside a different
JetStream cluster. I used Benthos to do this message duplicating.
regions to each other, using __Benthos__.
In this project, I provided an example in which I mirrored one stream inside a JetStream cluster to another stream
inside a different JetStream cluster.
In order to do this, I used __Benthos__ as a third party service between the two clusters.

## Benthos configs

Benthos is a high performance and resilient stream processor, able to connect
various sources and sinks in a range of brokering patterns and perform hydration, enrichments,
transformations and filters on payloads.
Read more about [Benthos](https://github.com/benthosdev/benthos).

### Input

Input is our first nats js service that is the main jet-stream cluster.
We config our benthos input based of the configs in our
project.
Input is our first NATS (JetStream) service that is the main cluster.

```yaml
input:
label: "nats1"
nats_jetstream:
urls: [ "nats://0.0.0.0:4222" ]
queue: ""
subject: "snapp*"
subject: "snapp*" # subject
durable: ""
stream: "snapp"
stream: "snapp" # stream
bind: false
deliver: all
```
### Output
Output is our back-up nats js service, which will be mirrored
Output is the other NATS (JetStream) service, which will be mirrored
by the main service.
```yaml
Expand All @@ -39,11 +43,11 @@ output:
subject: "snapp*"
```
## Setup
## Example Setup
Use the following command to start Benthos, two NATS clusters, bootstrap service, two consumers, and one publisher
to see the mirroring between clusters:
```shell
docker-compose up
```
```

0 comments on commit 979ff1a

Please sign in to comment.