Skip to content

Go API + Traefik (Load Balancer) + NATS Streaming. Example for using docker-compose scale

Notifications You must be signed in to change notification settings

dxavx/go_traefik_nats-streaming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go API + Traefik (Load Balancer) + NATS-Streaming

Docker Compose Actions Workflow

There is an example of using the “Traefik" load balancer, message broker "NATS-Streaming" and Go code with the ability to increase the number of instances of the container with the Go code (scaling ).

In the file build.sh you can set the number of copies of the app: docker-compose -f./docker-compose.yml up -d -- scale subscriber=3

Start: bash build.sh

Publishing a random string http://localhost/v1/pub

You can view the message in the subscriber container console

Traefik GUI http://localhost:8080

Stop: bash purge.sh


Go API + Traefik (Load Balancer) + NATS-Streaming

Пример использования балансировщика “Traefik“, брокера сообщений "NATS-Streaming" и кода на Go с возможностью увеличивать количество экземпляров контейнера с кодом Go ( скейлинг ).

В файле build.sh вы можете указать количество копий приложения: docker-compose -f./docker-compose.yml up -d -- scale subscriber=3

Start: bash build.sh

Публикация сучайно строки http://localhost/v1/pub

Сообщение можно просмотреть в консоле контейнеров subscriber

Traefik GUI http://localhost:8080

Stop: bash purge.sh

About

Go API + Traefik (Load Balancer) + NATS Streaming. Example for using docker-compose scale

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published