LATEST
  • 👋Hi, there.
  • Guide
    • Configurations
    • Deployment
    • Enable EMQX
    • Enable Monitor
    • Enable APM
  • Angular Library
    • Core
    • Basic
    • Integration
  • Golang Library
    • Basic
    • Helper
    • Middlewares
    • Integration
  • Extend
    • Collector
    • Schedule
    • Worker
    • Serverless
  • Core Api
    • Common
    • Dynamic Configuration
    • Sessions
    • Mongo Rest
    • Public Cloud
    • Collaboration
  • Internal API
    • EMQX HTTP
  • OpenAPI
    • Queue
    • MQTT
  • LowCode
  • Github
Powered by GitBook
On this page
  • Pre-requisite
  • Deploy
  • Environement
  • MODE
  • NATS_HOSTS *required
  • NATS_NKEY *required
  • License

Was this helpful?

Edit on GitHub
  1. Extend

Worker

Last updated 1 year ago

Was this helpful?

Distribution message event callback worker node

Pre-requisite

  • Nats cluster needs to enable JetStream

  • Services and applications should work together the same nats tenant

Deploy

The worker node subscribes to the work queue (non-persistent), including events from Schdule, MQ (message queue) and third-party. The node that gets the message triggers the event and transfers the result to the data stream. Node support horizontal expansion shunt pressure.

The main container image is:

  • ghcr.io/weplanx/worker:latest

  • registry.cn-shenzhen.aliyuncs.com/weplanx/worker:latest

The case will use Kubernetes deployment orchestration, replicate deployment (modify as needed).

apiVersion: apps/v1
kind: Deployment
metadata:
  name: worker
spec:
  selector:
    matchLabels:
      app: worker
  template:
    metadata:
      labels:
        app: worker
    spec:
      containers:
        - image: registry.cn-shenzhen.aliyuncs.com/weplanx/worker:latest
          imagePullPolicy: Always
          name: worker
          env:
            - name: MODE
              value: release
            - name: NATS_HOSTS
              value: <*** your nats hosts ***>
            - name: NATS_NKEY
              value: <*** your nats nkey***>

Environement

MODE

  • Working mode, default debug

NATS_HOSTS *required

  • Nats connection host, use , split

NATS_NKEY *required

  • Nats NKEY authentication

License

BSD-3-Clause License