Skip to content

Configuration

The broker is configured via a YAML file (default: smqbroker.yaml).

smqbroker --config /path/to/config.yaml

Reference

slack:
  bot_token: "${SLACK_BOT_TOKEN}"
  app_token: "${SLACK_APP_TOKEN}"
  socket_mode: true

broker:
  poll_interval: 5s        # How often to poll for unclaimed messages
  claim_timeout: 60s       # Time before an unclaimed message is re-offered
  processing_timeout: 300s # Time before a claimed message is considered stalled
  max_attempts: 3          # Max delivery attempts before dead-lettering

state:
  driver: sqlite
  sqlite:
    path: "./smqbroker.db"

control:
  channel: "#smq-ctrl"     # Channel for broker notifications
  daily_digest:
    enabled: true
    time: "09:00"
    timezone: "Australia/Sydney"
  stall_warnings:
    enabled: true
    threshold_pct: 80
  app_home:
    enabled: true
    refresh_on_open: true
  bookmarks:
    prometheus_url: "http://localhost:9090/metrics"
    docs_url: ""
    config_url: ""
  notifications:
    dead_letter: true
    subscription_changes: true
    broker_lifecycle: true
    consumer_stalls: true

logging:
  level: info              # debug, info, warn, error
  format: json             # json or console

metrics:
  enabled: true
  port: 9090

Slack Tokens

Tokens support environment variable interpolation using ${VAR} syntax. Set them as environment variables rather than hardcoding in the config file:

export SLACK_BOT_TOKEN=xoxb-...
export SLACK_APP_TOKEN=xapp-...

Broker Tuning

Parameter Default Description
poll_interval 5s Frequency of scanning for unclaimed messages
claim_timeout 60s How long a message can sit unclaimed before being re-offered
processing_timeout 300s Maximum time for a consumer to process a claimed message
max_attempts 3 Number of delivery attempts before routing to DLQ

Metrics

When enabled, Prometheus metrics are exposed at http://localhost:{port}/metrics. The web dashboard and SSE event feed are served on the same port.