All Projects → bmcustodio → Docker Compose Nats Cluster

bmcustodio / Docker Compose Nats Cluster

Licence: apache-2.0
A three-node NATS cluster running on top of Docker Compose for testing purposes.

Projects that are alternatives of or similar to Docker Compose Nats Cluster

Go Micro Boilerplate
The boilerplate of the GoLang application with a clear microservices architecture.
Stars: ✭ 147 (+374.19%)
Mutual labels:  nats, docker-compose
Example Api
A base API project to bootstrap and prototype quickly.
Stars: ✭ 27 (-12.9%)
Mutual labels:  docker-compose
Notmail bot
Telegram bot that acts as an email client
Stars: ✭ 23 (-25.81%)
Mutual labels:  docker-compose
Pipe
Multi provider event grid written in go
Stars: ✭ 9 (-70.97%)
Mutual labels:  nats
Ngx mruby Package Builder
Package Builder of ngx_mruby with Docker
Stars: ✭ 25 (-19.35%)
Mutual labels:  docker-compose
Composerize
🏃→🎼 docker run asdlksjfksdf > docker-composerize up
Stars: ✭ 872 (+2712.9%)
Mutual labels:  docker-compose
Fastapi Realworld Example App
Backend logic implementation for https://github.com/gothinkster/realworld with awesome FastAPI
Stars: ✭ 911 (+2838.71%)
Mutual labels:  docker-compose
Compreface
Free and open-source face recognition system from Exadel
Stars: ✭ 947 (+2954.84%)
Mutual labels:  docker-compose
Docker Dev
Development tools for Docker
Stars: ✭ 21 (-32.26%)
Mutual labels:  docker-compose
Dockerized lara
Build your Laravel App with Redis - Mongodb - MariaDB - Nginx - php7 - zsh
Stars: ✭ 9 (-70.97%)
Mutual labels:  docker-compose
Nats.rb
Ruby client for NATS, the cloud native messaging system.
Stars: ✭ 850 (+2641.94%)
Mutual labels:  nats
Wordpress Starter
📦 A starter template for WordPress websites
Stars: ✭ 26 (-16.13%)
Mutual labels:  docker-compose
Docker Taiga
Docker container for Taiga https://taiga.io
Stars: ✭ 14 (-54.84%)
Mutual labels:  docker-compose
Unilinks
Plataforma para encontrar os links das aulas virtuais gravadas.
Stars: ✭ 25 (-19.35%)
Mutual labels:  docker-compose
Docker Compose Nodejs Examples
Finally some real world examples on getting started with Docker Compose and Nodejs
Stars: ✭ 944 (+2945.16%)
Mutual labels:  docker-compose
Wsl Docker Git Setup
Shell script to configure Windows Subsystem for Linux (WSL) & Ubuntu on Windows to use docker and docker-compose as well as a git-enabled prompt
Stars: ✭ 23 (-25.81%)
Mutual labels:  docker-compose
Vj4 Docker
Dockerfile and docker-compose.yml for vijos/vj4.
Stars: ✭ 26 (-16.13%)
Mutual labels:  docker-compose
Nats K8s
Various k8s/nats artifacts in experimental work.
Stars: ✭ 12 (-61.29%)
Mutual labels:  nats
Mrseedbox
[unmaintained] A Containerized Seedbox with Embedded Media Player
Stars: ✭ 30 (-3.23%)
Mutual labels:  docker-compose
Docker Compose Grafana Influxdb
Demonstration scripts for running Grafana with InfluxDB as datasource.
Stars: ✭ 29 (-6.45%)
Mutual labels:  docker-compose

docker-compose-nats-cluster

A three-node NATS cluster running on top of Docker Compose, for testing purposes.

License

Starting

To start the NATS cluster, run

$ docker-compose up
(...)
nats-2_1  | [1] 2020/03/07 13:40:29.890917 [INF] Starting nats-server version 2.1.4
(...)
nats-1_1  | [1] 2020/03/07 13:40:29.841022 [INF] Starting nats-server version 2.1.4
(...)
nats-3_1  | [1] 2020/03/07 13:40:29.895016 [INF] Starting nats-server version 2.1.4
(...)

Connecting

To connect to the NATS cluster, point your NATS client at one of 127.0.0.1:{14222,24222,34222}.

Example

Install nats-pub and nats-sub:

$ go get github.com/nats-io/nats.go/examples/nats-pub
$ go get github.com/nats-io/nats.go/examples/nats-sub

Point nats-sub at nats://127.0.0.1:14222 and at the foo subject:

$ nats-sub -s nats://127.0.0.1:14222 foo
Listening on [foo]

Now, in another shell, point nats-pub at nats://127.0.0.1:24222 and nats://127.0.0.1:34222 and at the foo subject:

$ nats-pub -s nats://127.0.0.1:24222 foo bar
Published [foo] : 'bar'
$ nats-pub -s nats://127.0.0.1:34222 foo baz
Published [foo] : 'baz'

By then, you should start seeing messages arriving in the shell where nats-sub is running:

$ nats-sub -s nats://127.0.0.1:14222 foo
Listening on [foo]
[#1] Received on [foo] : 'bar'
[#2] Received on [foo] : 'baz'

Stopping

To stop the NATS cluster, hit Ctrl+C.

Destroying

To destroy the NATS cluster, run

$ docker-compose down
Removing docker-compose-nats-cluster_nats-1_1 ... done
Removing docker-compose-nats-cluster_nats-3_1 ... done
Removing docker-compose-nats-cluster_nats-2_1 ... done
Removing network docker-compose-nats-cluster_main

License

Copyright 2017-2020 bmcustodio

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].