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
      • Dependency
      • Configuration
      • Configuration instructions
      • Description of stored data
      • Auto Refresh
      • Example
    • 📘SQL database source
    • 📋Nacos source
    • 🗄Etcd source
    • 📙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-06-07
Contents

📗Zookeeper source

# Dependency

LiteFlow supports placing the configuration in the zk cluster, based on the zk notification mechanism, LiteFlow supports real-time modification of the process

If you need to use zk, you need to add the following additional dependency:

<dependency>
    <groupId>com.yomahub</groupId>
    <artifactId>liteflow-rule-zk</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={\
        "connectStr":"127.0.0.1:2181,127.0.0.1:2182,127.0.0.1:2183",\
        "nodePath":"/liteflow/rule"\
    }
    
    liteflow:
      rule-source-ext-data-map:
        connectStr: 127.0.0.1:2181,127.0.0.1:2182,127.0.0.1:2183
        nodePath: /liteflow/rule
    
    // Make sure to add code blocks to your code group

    # Configuration instructions

    Configuration Item Description
    connectStr 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 ZK, 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

    Any rule changes in the zk node will be automatically pushed to the business system for real-time smooth hot 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 ZK rule, here is a small demo that you can pull to run locally, you need to replace the ZK 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
    📕Local rule file
    📘SQL database source

    ← 📕Local rule file 📘SQL database source→

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