Worker

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

Last updated

Was this helpful?