Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
b5a7264
create helper function
sampaiodiego Feb 11, 2025
bb2c2d0
new nats broker
sampaiodiego Feb 11, 2025
a941922
implement broadcastLocal
sampaiodiego Feb 14, 2025
7480f2b
provide a way to use NatsBroker
sampaiodiego Apr 28, 2026
10abd2e
use nats broker on ci
sampaiodiego Apr 28, 2026
9f09e97
fix nats broker call to handle empty responses
sampaiodiego Apr 28, 2026
640629d
add BROKER env var to compose services
sampaiodiego Apr 28, 2026
2a700d3
validate NatsBroker is running
sampaiodiego Apr 28, 2026
26ffb45
implement service lifecycle methods and complete destroyService logic
sampaiodiego Apr 29, 2026
514b469
give NatsBroker a node identity and separate subject namespaces
sampaiodiego Aug 21, 2026
c7237c0
propagate service errors over NATS instead of swallowing them
sampaiodiego Aug 21, 2026
6bd59e8
cover NatsBroker with a fake nats connection
sampaiodiego Aug 21, 2026
67d9e0d
align the nats dependency and let dev compose select the broker
sampaiodiego Aug 21, 2026
a3de8b0
make the CI broker selectable instead of hardcoding nats
sampaiodiego Aug 21, 2026
91a83a6
fix lint
sampaiodiego Aug 24, 2026
9a0bd20
use nats broker on CI (remove before merge)
sampaiodiego Aug 24, 2026
2210a7f
do not let a failing lifecycle hook take down the process
sampaiodiego Aug 25, 2026
4a111b9
retry a call that reached no responder
sampaiodiego Aug 25, 2026
e337663
add primeOnce, a lazy initializer that does not cache failures
sampaiodiego Aug 25, 2026
be8a55c
read the login expiration on first login, not at boot
sampaiodiego Aug 25, 2026
5a4bb5d
prime the transcript settings on first use, not at boot
sampaiodiego Aug 25, 2026
149f7c6
prime the abac config again when a decision needs it
sampaiodiego Aug 25, 2026
7d098e4
answer a call from the local service instead of the wire
sampaiodiego Aug 25, 2026
217fde5
share one local service registry between the brokers
sampaiodiego Aug 25, 2026
fd31d68
document the nats broker
sampaiodiego Aug 25, 2026
dedf72e
document the service brokers
sampaiodiego Aug 25, 2026
7278f20
prime the abac config on every path that needs a PDP
sampaiodiego Aug 25, 2026
401bac6
document the two priming mistakes the nats broker surfaced
sampaiodiego Aug 25, 2026
95148ae
add streams and context
sampaiodiego Sep 1, 2026
43ff99e
wait for service dependencies in NatsBroker instead of priming on fir…
sampaiodiego Sep 23, 2026
79f6219
implement emitToOne on NatsBroker with a queue group per service
sampaiodiego Sep 29, 2026
856ba07
document emitToOne and the broadcastToServices gap on NatsBroker
sampaiodiego Sep 29, 2026
d6c44ac
docs: improve service broker doc
sampaiodiego Sep 29, 2026
928ac28
stop NatsBroker services and exit on SIGTERM
sampaiodiego Sep 30, 2026
f8a4e37
document graceful shutdown on NatsBroker
sampaiodiego Sep 30, 2026
639cae8
drop Moleculer comparisons from NatsBroker comments
sampaiodiego Sep 30, 2026
4c0e41e
remove comment
sampaiodiego Oct 8, 2026
34b4f94
reject setBroker once the API has started
sampaiodiego Oct 8, 2026
d6340b4
share the default service dependencies between the network brokers
sampaiodiego Oct 8, 2026
36e6966
read the NatsBroker environment in its factory, not in the class
sampaiodiego Oct 8, 2026
8298227
drop NatsBroker state derivable from its connection and dependencies
sampaiodiego Oct 8, 2026
d113c31
copy a payload only when it carries a stream
sampaiodiego Oct 8, 2026
77dda08
docs: LocalBroker is installed only outside microservices mode
sampaiodiego Oct 8, 2026
d82927a
docs: note that NatsBroker has no tracing, metrics or namespaces
sampaiodiego Oct 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions .github/workflows/ci-test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ on:
type: string
transporter:
type: string
broker:
default: 'nats' # TODO remove default before merge
required: false
type: string
mongodb-version:
default: "['8.0']"
required: false
Expand Down Expand Up @@ -82,7 +86,7 @@ jobs:
# if building for production on develop branch or release, add suffix for coverage images
DOCKER_TAG_SUFFIX_ROCKETCHAT: ${{ inputs.coverage == matrix.mongodb-version && (github.event_name == 'release' || github.ref == 'refs/heads/develop') && '-cov' || '' }}
MONGODB_VERSION: ${{ matrix.mongodb-version }}
COVERAGE_DIR: '/tmp/coverage/${{ startsWith(inputs.type, ''api'') && ''api'' || inputs.type }}'
COVERAGE_DIR: "/tmp/coverage/${{ startsWith(inputs.type, 'api') && 'api' || inputs.type }}"
COVERAGE_FILE_NAME: '${{ inputs.type }}-${{ matrix.shard }}.json'
COVERAGE_REPORTER: ${{ inputs.coverage == matrix.mongodb-version && 'json' || '' }}

Expand Down Expand Up @@ -204,6 +208,7 @@ jobs:
COMPOSE_PROFILES: ${{ inputs.type == 'api' && 'api' || '' }}
TEST_MODE: ${{ startsWith(inputs.type, 'api') && 'api' || 'true' }}
FIPS_OVERRIDE: ${{ inputs.fips && '-f docker-compose-ci.fips.yml' || '' }}
BROKER: ${{ inputs.broker }}
run: |
read -r -a fips_override <<< "$FIPS_OVERRIDE"
DEBUG_LOG_LEVEL=${DEBUG_LOG_LEVEL:-0} docker compose -f docker-compose-ci.yml "${fips_override[@]}" up -d --wait
Expand All @@ -213,11 +218,20 @@ jobs:

- name: Wait services to start up
if: inputs.release == 'ee'
env:
BROKER: ${{ inputs.broker }}
run: |
docker ps

until docker compose -f docker-compose-ci.yml logs ddp-streamer-service | grep -q "MoleculerBroker started successfully"; do
echo "Waiting 'ddp-streamer' to start up"
# assert the broker that was asked for actually started, so a silent
# fallback to the other one fails the run instead of passing
expected="MoleculerBroker started successfully"
if [ "$BROKER" = 'nats' ]; then
expected="NatsBroker started successfully"
fi

until docker compose -f docker-compose-ci.yml logs ddp-streamer-service | grep -q "$expected"; do
echo "Waiting 'ddp-streamer' to start up with $expected"
((c++)) && ((c==10)) && docker compose -f docker-compose-ci.yml logs ddp-streamer-service && exit 1
sleep 10
done;
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Read the doc that matches the task instead of scanning `docs/` wholesale.
- [docs/api-endpoint-migration.md](docs/api-endpoint-migration.md) — migrating `API.v1.addRoute()` to the validated `API.v1.get()`/`.post()`/… pattern
- [docs/ajv-instances.md](docs/ajv-instances.md) — when to use `ajv` vs `ajvQuery` in `@rocket.chat/rest-typings`
- [docs/apps-engine-migration.md](docs/apps-engine-migration.md) — phased extraction of apps execution into a microservice
- [docs/service-brokers.md](docs/service-brokers.md) — how services reach each other: the local and Moleculer brokers, how events and stream relays reach other instances in each deployment, and the calls that only work because both ends share a process
- [docs/service-brokers.md](docs/service-brokers.md) — how services reach each other: the three brokers (local, Moleculer, NATS), what the new NATS one had to rebuild, how events and stream relays reach other instances in each deployment, and the calls that only work because both ends share a process

### Build and tooling

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
"moment-timezone": "^0.5.48",
"mongo-message-queue": "^1.1.0",
"mongodb": "6.16.0",
"nats": "^2.28.2",
"nats": "^2.29.1",
"node-dogstatsd": "^0.0.7",
"node-fetch": "2.7.0",
"node-rsa": "^1.1.1",
Expand Down
7 changes: 7 additions & 0 deletions docker-compose-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ services:
- MONGO_URL=mongodb://mongo:27017/rocketchat?replicaSet=rs0
- 'MONGO_OPLOG_URL=${MONGO_OPLOG_URL:-}'
- 'TRANSPORTER=${TRANSPORTER:-}'
- 'BROKER=${BROKER:-}'
- MOLECULER_LOG_LEVEL=info
- 'ROCKETCHAT_LICENSE=${ENTERPRISE_LICENSE:-}'
- 'COVERAGE_DIR=${COVERAGE_DIR:-}'
Expand Down Expand Up @@ -71,6 +72,7 @@ services:
environment:
- MONGO_URL=mongodb://mongo:27017/rocketchat?replicaSet=rs0
- 'TRANSPORTER=${TRANSPORTER:-}'
- 'BROKER=${BROKER:-}'
- MOLECULER_LOG_LEVEL=info
extra_hosts:
- 'host.docker.internal:host-gateway'
Expand All @@ -92,6 +94,7 @@ services:
environment:
- MONGO_URL=mongodb://mongo:27017/rocketchat?replicaSet=rs0
- 'TRANSPORTER=${TRANSPORTER:-}'
- 'BROKER=${BROKER:-}'
- MOLECULER_LOG_LEVEL=info
extra_hosts:
- 'host.docker.internal:host-gateway'
Expand All @@ -113,6 +116,7 @@ services:
environment:
- MONGO_URL=mongodb://mongo:27017/rocketchat?replicaSet=rs0
- 'TRANSPORTER=${TRANSPORTER:-}'
- 'BROKER=${BROKER:-}'
- MOLECULER_LOG_LEVEL=info
extra_hosts:
- 'host.docker.internal:host-gateway'
Expand All @@ -134,6 +138,7 @@ services:
environment:
- MONGO_URL=mongodb://mongo:27017/rocketchat?replicaSet=rs0
- 'TRANSPORTER=${TRANSPORTER:-}'
- 'BROKER=${BROKER:-}'
- MOLECULER_LOG_LEVEL=info
extra_hosts:
- 'host.docker.internal:host-gateway'
Expand Down Expand Up @@ -161,6 +166,7 @@ services:
environment:
- MONGO_URL=mongodb://mongo:27017/rocketchat?replicaSet=rs0
- 'TRANSPORTER=${TRANSPORTER:-}'
- 'BROKER=${BROKER:-}'
- MOLECULER_LOG_LEVEL=info
extra_hosts:
- 'host.docker.internal:host-gateway'
Expand All @@ -183,6 +189,7 @@ services:
- 'TEST_MODE=${TEST_MODE:-true}'
- MONGO_URL=mongodb://mongo:27017/rocketchat?replicaSet=rs0
- 'TRANSPORTER=${TRANSPORTER:-}'
- 'BROKER=${BROKER:-}'
- MOLECULER_LOG_LEVEL=info
extra_hosts:
- 'host.docker.internal:host-gateway'
Expand Down
Loading
Loading