LiteFlow LiteFlow
💒Home
📚Documents
💖Donation
🚀Plugin
  • About LiteFlow
  • Update Record
Community
Users
Gitee (opens new window)
Github (opens new window)
  • 简体中文 (opens new window)
  • English (opens new window)
💒Home
📚Documents
💖Donation
🚀Plugin
  • About LiteFlow
  • Update Record
Community
Users
Gitee (opens new window)
Github (opens new window)
  • 简体中文 (opens new window)
  • English (opens new window)
  • 🍤Introduction
  • 🍓Features
  • 🍟Quick Start(Hello world)

    • 🍄Notice
    • 🌿Springboot environment

      • 🧬Dependency
      • ⚙️Config
      • 🛫Execute
    • 🌱Spring environment

      • 🧬Dependency
      • ⚙️Config
      • 🛫Execute
    • 🌵Other environment

      • 🍄Notice
      • 🧬Dependency
      • ⚙️Config
      • 🛫Execute
  • 🍢Configuration item

    • 🍄Notice
    • 🌿Springboot environment
    • 🌱Spring environment
    • 🌵Other environment
  • 🗂Rules file

    • 📔Rules file format
    • 📕Local rule file
    • 📗Zookeeper source
    • 📘SQL database source
    • 📋Nacos source
    • 🗄Etcd source
      • Dependency
      • Configuration
      • Configuration instructions
      • Description of stored data
      • Auto Refresh
      • Example
    • 📙Custom source
  • 🔗General components

    • 📎Common component
    • ✂️Switch component
    • 📌If component
    • 🧬For component
    • ⛓While component
    • 🧿Break component
  • 🧩How to write EL rules

    • 🍄Notice
    • 🌴Serial mode
    • 🎋Parallel mode
    • 🌾Switch mode
    • 🌵If mode
    • 🌳Loop mode
    • 🍁Use sub chain
    • 🍂Use sub variables
    • 💐Complex example
    • 🌻About semicolons
    • 🌰About comments
    • 🐚Component Name Package
  • 🌮Data context

    • 🍄Notice
    • 🌯Definition and use
    • 🪶Pass initialized context
  • 🛩Flow executor

    • 🍄Notice
    • 🎡Executor method
    • 🎢Chain input parameter
    • 🎈LiteflowResponse object
  • 🍋Script component

    • 🍫Choose a script language
    • 🍕Define script component
    • 🌯Define file script
    • 🍣Interact with java
    • 🍘Dynamic refresh script
  • 🍇Declarative component

    • 🥭What is a declarative component
    • 🧅Class level declaration
    • 🥥Method level declaration
  • 🎲Dynamic rules

    • 🍄Notice
    • 🎯How to build
  • 🎨Advanced features

    • 🍒Pre & Finally components
    • 🥠Substitute component
    • 🍉Component Parameters
    • 🍑Component alias
    • 🍍Component tag
    • 🥝Component event
    • 🥑Implicit chain
    • 🍕Private delivery
    • 🍣Component retry
    • 🍖Smooth hot refresh
    • 🍪Component aspect
    • 🍡Step information
    • 🧊Exceptions
    • 🧇Printing details
    • 🧁Custom request id
    • 🌭Multiple type rules
    • 🥗Asynchronous thread pool
    • 🍿Custom component executor
    • 🍥Simple monitor
    • 🧉DTD in Xml
  • ⛱Test cases and demo

    • 🪁Test cases
    • 🪀Demo
  • 🪂Performance
  • v2.9.X文档
  • 🗂Rules file
铂赛东
2022-10-12
Contents

🗄Etcd source

Starting from v2.9.0, LiteFlow supports Etcd' rule configuration source.

# Dependency

<dependency>
    <groupId>com.yomahub</groupId>
    <artifactId>liteflow-rule-etcd</artifactId>
    <version>2.9.3</version>
</dependency>

# Configuration

You don't need to configure the liteflow.ruleSource path anymore.

Just configure the extra parameters of the plugin:

    liteflow:
      rule-source-ext-data-map:
        endpoints: http://127.0.0.1:2379
        chainPath: /liteflow/chain
        scriptPath: /liteflow/script
    
    liteflow.rule-source-ext-data={\
        "endpoints":"http://127.0.0.1:2379",\
        "chainPath":"/liteflow/chain",\
        "scriptPath":"/liteflow/script"\
    }
    
    // Make sure to add code blocks to your code group

    # Configuration instructions

    Configuration Item Description
    endpoints The connection string of zk, which can be a cluster
    chainPath Your rule directory node (there will be many rules below, one node per rule)
    scriptPath Your script directory node (there will be many scripts below, one node per script)

    # Description of stored data

    In etcd, suppose your chainPath is: /liteflow/chain

    Then each node under this path is a rule, the key of the node is chainId, and the value is simple EL (THEN(a,b,c)), for example:

    /liteflow/chain

    ---chain1

    ---chain2

    For the script path, suppose your scriptPath is: /liteflow/script

    Then each node under this path is a script component. The key of the node has a fixed format: script component ID:script type:script name, and the value is the script data, for example:

    /liteflow/script

    ---s1:script:script component s1

    ---s2:script:script component s2

    About the script type, you can refer to the section Defining Script Components.

    # Auto Refresh

    Using this Etcd configuration source plug-in, any rule changes in the Etcd node will be automatically pushed to the business system for real-time refresh. You don't need to do anything.

    # Example

    In order to make it easy for everyone to get started with the configuration of the Etcd rule, here is a small demo that you can pull to run locally, you need to replace the Etcd configuration information.

    Before running the project, read the readme.txt file in the project.

    https://github.com/bryan31/liteflow-ext-rule-demo

    Help us improve this document (opens new window)
    last update: 2022/11/30, 22:42:09
    📋Nacos source
    📙Custom source

    ← 📋Nacos source 📙Custom source→

    Theme by Vdoing | Copyright © 2020-2022 铂赛东 | MIT License
    • 跟随系统
    • 浅色模式
    • 深色模式
    • 阅读模式