RuleGo RuleGo
🏠Home
  • Quick Start
  • Rule Chain
  • Standard Components
  • Extension Components
  • Custom Components
  • Visualization
  • RuleGo-Server
  • RuleGo-MCP-Server
  • AOP
  • Trigger
  • Advanced Topics
  • Performance
  • Standard Components
  • Extension Components
  • Custom Components
  • Components Marketplace
  • Overview
  • Quick Start
  • Routing
  • DSL
  • API
  • Options
  • Components
🔥Editor (opens new window)
  • RuleGo Editor (opens new window)
  • RuleGo Server (opens new window)
  • StreamSQL
  • Github (opens new window)
  • Gitee (opens new window)
  • Changelog (opens new window)
  • English
  • 简体中文
🏠Home
  • Quick Start
  • Rule Chain
  • Standard Components
  • Extension Components
  • Custom Components
  • Visualization
  • RuleGo-Server
  • RuleGo-MCP-Server
  • AOP
  • Trigger
  • Advanced Topics
  • Performance
  • Standard Components
  • Extension Components
  • Custom Components
  • Components Marketplace
  • Overview
  • Quick Start
  • Routing
  • DSL
  • API
  • Options
  • Components
🔥Editor (opens new window)
  • RuleGo Editor (opens new window)
  • RuleGo Server (opens new window)
  • StreamSQL
  • Github (opens new window)
  • Gitee (opens new window)
  • Changelog (opens new window)
  • English
  • 简体中文

广告采用随机轮播方式显示 ❤️成为赞助商
  • Quick Start

  • Rule Chain

  • Standard Components

  • Extension Components

    • Extension Components Overview
    • filter

    • transform

    • external

      • redisClient
      • kafkaProducer
      • natsClient
      • rabbitmqClient
      • opengeminiWrite
      • opengeminiQuery
      • MongoDB Client
      • Redis Publisher
      • grpcClient
      • OpenTelemetry
      • BeanstalkdWorker
      • BeanstalkdTube
      • WukongimSender
      • NSQ Client
        • Configuration
        • Working Principle
        • Relation Type
        • Execution Result
        • Configuration Example
        • Application Example
      • Pulsar Client
    • ai

    • ci

    • IoT

  • Custom Components

  • Components marketplace

  • Visualization

  • AOP

  • Trigger

  • Advanced Topic

  • RuleGo-Server

  • FAQ

  • Endpoint Module

  • Support

  • StreamSQL

目录

NSQ Client

x/nsqClient component: v0.33.0+ NSQ producer component. Used to publish messages to specified NSQ topics.

# Configuration

This component supports reusing shared NSQ connection clients through the server field to avoid creating duplicate connections. See Component Connection Reuse.

Field Type Required Description Default Value
server string Yes NSQ server address, supports multiple formats:
1. Single nsqd: "127.0.0.1:4150"
2. Multiple nsqd: "127.0.0.1:4150,127.0.0.1:4151"
3. Lookupd address: "http://127.0.0.1:4161,http://127.0.0.1:4162"
127.0.0.1:4150
topic string Yes Publish topic, supports using Component Configuration Variables for dynamic configuration device_msg
authToken string No NSQ authentication token None
certFile string No TLS certificate file path None
certKeyFile string No TLS private key file path None

# Working Principle

  1. The component initializes by connecting to the NSQ server based on configuration
  2. Supports connecting to single or multiple nsqd instances, also supports discovering nsqd through lookupd
  3. Upon receiving a message, publishes the message content to the specified topic
  4. Routes through Success chain upon successful publishing, routes through Failure chain on failure
  5. The component automatically manages connection lifecycle, including reconnection

# Relation Type

  • Success: Message is sent to Success chain in the following cases:
    • Message successfully published to NSQ server
    • Received confirmation from NSQ server
  • Failure: Message is sent to Failure chain in the following cases:
    • Failed to connect to NSQ server
    • Failed to publish message
    • Configuration parameter error
    • TLS certificate loading failure

# Execution Result

After component execution:

  • msg.data remains unchanged
  • metadata remains unchanged
  • msgType remains unchanged

# Configuration Example

{
  "id": "s5",
  "type": "x/nsqClient",
  "name": "Publish to NSQ",
  "debugMode": true,
  "configuration": {
    "server": "127.0.0.1:4150",
    "topic": "device.msg.${deviceType}",
    "authToken": "your-auth-token"
  }
}
1
2
3
4
5
6
7
8
9
10
11

# Application Example

Application example reference: nsq_client_test (opens new window)

Edit this page on GitHub (opens new window)
Last Updated: 2025/07/22, 15:00:05
WukongimSender
Pulsar Client

← WukongimSender Pulsar Client→

Theme by Vdoing | Copyright © 2023-2025 RuleGo Team | Apache 2.0 License

  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式