M8F-148: Add NATS UI for monitoring events and system stats; move NATS services to m8flow-nats-docker-compose.yml#84
Conversation
| retries: 10 | ||
| restart: unless-stopped | ||
|
|
||
| m8flow-nats-consumer: |
There was a problem hiding this comment.
Shouldn't we move "m8flow-nats-consumer" to m8flow-nats-docker-compose.yml ?
There was a problem hiding this comment.
to optimize the core deployment, the NATS server and NATS-UI have been moved to a standalone Docker Compose configuration. While the m8flow-nats-consumer remains part of the main application build, its execution is conditionally controlled by the M8FLOW_NATS_ENABLED environment variable. This modular approach reduces the resource overhead of the main stack and gives customers the flexibility to use their own NATS infrastructure or alternative UI tools if preferred.
There was a problem hiding this comment.
Please update docs, README.md etc. describing how to use this docker compose.
f9d884b to
8209763
Compare
…r to `m8flow-nats-docker-compose.yml`
8209763 to
97ec170
Compare
docker/m8flow-docker-compose.yml
Outdated
There was a problem hiding this comment.
m8flow-backend still depends on a nats service that no longer exists in that file.
|



JIRA Ticket
M8F-148
Description
NATS UI & M8Flow NATS Implementation
NATS UI — NUI
NUI is an open-source browser-based dashboard for managing and monitoring a NATS server. In the M8Flow stack it runs as a Docker container (
ghcr.io/nats-nui/nui:latest) accessible at port 8282.Features
m8flow-dedup)M8Flow NATS Implementation
1. API Key Authentication
Tenant admins generate an API key via
POST /m8flow/nats-tokens.m8f_...) is shown once and never storedM8FLOW_NATS_SALT) inm8flow_nats_tokenshmac.compare_digestto prevent timing attacks2. NATS Consumer (consumer.py)
A standalone async Python service that bridges NATS JetStream to SpiffWorkflow:
M8FLOW_EVENTSapi_keyvia NatsTokenServicem8flow-dedup) blocks duplicatetenant_id + event_idpairs (configurable TTL)ProcessInstanceServicedirectly inside Flask app context — no HTTP hopmsg.nak(delay=5)on failure;msg.ack()on success3. Docker Split Architecture
m8flow-nats-stackm8flow-defaultm8flow-docker-compose.ymlThe consumer connects via the shared
m8flow_defaultDocker network, so the NATS stack can be restarted independently. The consumer auto-reconnects on disconnect.Event Message Schema
{ "id": "unique-event-uuid", "tenant_id": "your-tenant-uuid", "api_key": "m8f_...", "process_identifier": "group-name/process-model-name", "username": "username@tenant_slug", "payload": {} }Type
Changes
Testing
Prerequisites
http://localhost:82821. Connect NUI to NATS Server
http://localhost:8282nats://nats:4222admin(or value ofM8FLOW_NATS_USER)M8FLOW_NATS_PASSWORD)2. Verify Stream Exists
M8FLOW_EVENTSis listed with subjectm8flow.events.>3. Publish a Test Event via NUI
m8flow.events.<your-tenant-uuid>.trigger{ "id": "test-event-001", "tenant_id": "your-tenant-uuid", "api_key": "m8f_...", "process_identifier": "group/process-model", "username": "user@tenant", "payload": {} }4. Verify Consumer Processed the Event
m8flow-engine-consumershows 0 pending messages5. Verify Deduplication via NUI
m8flow-dedup<tenant-id>-test-event-001Related Issues
Closes #M8F-148