📋Nacos source
Starting from v2.9.0, LiteFlow supports Nacos' rule configuration source.
# Dependency
If using Nacos as the rule configuration source, you need to add the following additional plugin dependencies:
<dependency>
<groupId>com.yomahub</groupId>
<artifactId>liteflow-rule-nacos</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:
serverAddr: 127.0.0.1:8848
dataId: demo_rule
group: DEFAULT_GROUP
namespace: your namespace id
username: nacos
password: nacos
liteflow.rule-source-ext-data={\
"serverAddr":"127.0.0.1:8848",\
"dataId":"demo_rule",\
"group":"DEFAULT_GROUP",\
"namespace":"your namespace id",\
"username":"nacos",\
"password":"nacos"\
}
// Make sure to add code blocks to your code group
The above is just an example, you can replace the corresponding configuration with the Nacos of the actual scene.
notice
If you configure in yaml form, this json is a whole string, please enclose it in double quotes, do not configure it in yaml object format
notice
It should be noted that when using the Nacos configuration source, only the xml configuration is allowed to be stored in the Nacos.
# Auto Refresh
Using this Nacos configuration source plug-in, any rule changes in the Nacos 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 Nacos rule, here is a small demo that you can pull to run locally, you need to replace the Nacos configuration information.
Before running the project, read the readme.txt
file in the project.
https://github.com/bryan31/liteflow-ext-rule-demo