Skip to content

Commit

Permalink
NOISSUE - Enable JetStream on NATS (absmach#1885)
Browse files Browse the repository at this point in the history
* Enable Jestream on Nats

Signed-off-by: rodneyosodo <[email protected]>

* Update verbosity

Signed-off-by: rodneyosodo <[email protected]>

---------

Signed-off-by: rodneyosodo <[email protected]>
  • Loading branch information
rodneyosodo authored Aug 25, 2023
1 parent 5fa2bf4 commit 2252438
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
2 changes: 2 additions & 0 deletions docker/.env
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ MF_NGINX_MQTTS_PORT=8883

## Nats
MF_NATS_PORT=4222
MF_NATS_HTTP_PORT=8222
MF_NATS_JETSTREAM_KEY=u7wFoAPgXpDueXOFldBnXDh4xjnSOyEJ2Cb8Z5SZvGLzIZ3U4exWhhoIBZHzuNvh
MF_NATS_URL=nats://broker:${MF_NATS_PORT}

## RabbitMQ
Expand Down
9 changes: 7 additions & 2 deletions docker/brokers/nats.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
services:
broker:
image: nats:2.2.4-alpine
command: "-c /etc/nats/nats.conf -DV"
image: nats:2.9.21-alpine
command: "--config=/etc/nats/nats.conf"
volumes:
- ./../nats/:/etc/nats
environment:
- MF_NATS_PORT=${MF_NATS_PORT}
- MF_NATS_HTTP_PORT=${MF_NATS_HTTP_PORT}
- MF_NATS_JETSTREAM_KEY=${MF_NATS_JETSTREAM_KEY}
ports:
- ${MF_NATS_PORT}:${MF_NATS_PORT}
- ${MF_NATS_HTTP_PORT}:${MF_NATS_HTTP_PORT}
6 changes: 3 additions & 3 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ volumes:
mainflux-things-redis-volume:
mainflux-es-redis-volume:
mainflux-mqtt-broker-volume:

mainflux-broker-volume:

services:
nginx:
Expand Down Expand Up @@ -53,8 +53,8 @@ services:
restart: on-failure
networks:
- mainflux-base-net
ports:
- 4222:4222
volumes:
- mainflux-broker-volume:/data

things-db:
image: postgres:13.3-alpine
Expand Down
14 changes: 12 additions & 2 deletions docker/nats/nats.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
# maximum payload
max_payload: 268435456
max_payload: 1MB
max_connections: 1M
port: $MF_NATS_PORT
http_port: $MF_NATS_HTTP_PORT
trace: true

jetstream {
store_dir: "/data"
cipher: "aes"
key: $MF_NATS_JETSTREAM_KEY
max_mem: 1G
}

0 comments on commit 2252438

Please sign in to comment.