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
      • Pulsar Client
        • Configuration
        • Working Principle
        • Relation Type
        • Execution Result
        • Configuration Examples
          • Basic Configuration
          • Advanced Configuration
        • Application Example
    • ai

    • ci

    • IoT

  • Custom Components

  • Components marketplace

  • Visualization

  • AOP

  • Trigger

  • Advanced Topic

  • RuleGo-Server

  • FAQ

  • Endpoint Module

  • Support

  • StreamSQL

目录

Pulsar Client

x/pulsarClient component: v0.33.0+ Pulsar producer component. Used to publish messages to specified Pulsar topics.

# Configuration

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

Field Type Required Description Default Value
server string Yes Pulsar server address, format: pulsar://host:port pulsar://localhost:6650
topic string Yes Publish topic, supports using Component Configuration Variables for dynamic configuration /device/msg
key string No Message key template, supports using Component Configuration Variables for dynamic configuration, used for message routing and partitioning None
headers map[string]string No Custom message properties, supports both key and value using Component Configuration Variables for dynamic configuration None
authToken string No Pulsar JWT 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 Pulsar cluster based on configuration
  2. Creates a producer instance for sending messages
  3. Upon receiving a message, publishes the message content to the specified topic
  4. Supports setting message key and custom headers properties, both key and value support variable replacement
  5. Uses template engine to process variable replacement in topic, key, and headers
  6. Routes through Success chain upon successful publishing, routes through Failure chain on failure

# Relation Type

  • Success: Message is sent to Success chain in the following cases:
    • Message successfully published to Pulsar cluster
    • Received confirmation from Pulsar server
  • Failure: Message is sent to Failure chain in the following cases:
    • Failed to connect to Pulsar cluster
    • Failed to create producer
    • Failed to publish message
    • Configuration parameter error
    • TLS certificate loading failure
    • Template parsing failure
    • Topic is empty

# Execution Result

After component execution:

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

# Configuration Examples

# Basic Configuration

{
  "id": "s5",
  "type": "x/pulsarClient",
  "name": "Publish to Pulsar",
  "debugMode": true,
  "configuration": {
    "server": "pulsar://localhost:6650",
    "topic": "persistent://public/default/device-msg"
  }
}
1
2
3
4
5
6
7
8
9
10

# Advanced Configuration

{
  "id": "s6",
  "type": "x/pulsarClient",
  "name": "Publish to Pulsar with Properties",
  "debugMode": true,
  "configuration": {
    "server": "pulsar://localhost:6650",
    "topic": "persistent://public/default/device-${deviceType}",
    "key": "${deviceId}",
    "headers": {
      "source": "${source}",
      "timestamp": "${ts}",
      "deviceType": "${deviceType}"
    },
    "authToken": "your-jwt-token"
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

# Application Example

Application example reference: pulsar_client_test (opens new window)

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

← NSQ Client LLM→

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

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