-
Notifications
You must be signed in to change notification settings - Fork 829
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3d9bf57
commit 48b09d3
Showing
16 changed files
with
355 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<artifactId>dynamic-tp-example-adapter</artifactId> | ||
<groupId>org.dromara.dynamictp</groupId> | ||
<version>${revision}</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
<artifactId>dynamic-tp-example-adapter-liteflow</artifactId> | ||
|
||
<properties> | ||
<maven.deploy.skip>true</maven.deploy.skip> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-web</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-logging</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.yomahub</groupId> | ||
<artifactId>liteflow-spring-boot-starter</artifactId> | ||
<version>2.12.3</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.dromara.dynamictp</groupId> | ||
<artifactId>dynamic-tp-spring-boot-starter-adapter-liteflow</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-context</artifactId> | ||
</dependency> | ||
|
||
</dependencies> | ||
</project> |
37 changes: 37 additions & 0 deletions
37
...pter-liteflow/src/main/java/org/dromara/dynamictp/example/LiteflowExampleApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.dromara.dynamictp.example; | ||
|
||
import org.dromara.dynamictp.core.spring.EnableDynamicTp; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
|
||
/** | ||
* LiteflowExampleApplication related | ||
* | ||
* @author yanhom | ||
* @since 1.1.0 | ||
*/ | ||
@EnableDynamicTp | ||
@SpringBootApplication | ||
public class LiteflowExampleApplication { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(LiteflowExampleApplication.class, args); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...dapter/example-adapter-liteflow/src/main/java/org/dromara/dynamictp/example/cmp/ACmp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.dromara.dynamictp.example.cmp; | ||
|
||
import com.yomahub.liteflow.core.NodeComponent; | ||
import org.springframework.stereotype.Component; | ||
|
||
/** | ||
* ACmp related | ||
* | ||
* @author yanhom | ||
* @since 1.1.0 | ||
*/ | ||
@Component("a") | ||
public class ACmp extends NodeComponent { | ||
|
||
@Override | ||
public void process() { | ||
//do your business | ||
} | ||
} | ||
|
20 changes: 20 additions & 0 deletions
20
...dapter/example-adapter-liteflow/src/main/java/org/dromara/dynamictp/example/cmp/BCmp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.dromara.dynamictp.example.cmp; | ||
|
||
import com.yomahub.liteflow.core.NodeComponent; | ||
import org.springframework.stereotype.Component; | ||
|
||
/** | ||
* BCmp related | ||
* | ||
* @author yanhom | ||
* @since 1.1.0 | ||
*/ | ||
@Component("b") | ||
public class BCmp extends NodeComponent { | ||
|
||
@Override | ||
public void process() { | ||
//do your business | ||
} | ||
} | ||
|
20 changes: 20 additions & 0 deletions
20
...dapter/example-adapter-liteflow/src/main/java/org/dromara/dynamictp/example/cmp/CCmp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.dromara.dynamictp.example.cmp; | ||
|
||
import com.yomahub.liteflow.core.NodeComponent; | ||
import org.springframework.stereotype.Component; | ||
|
||
/** | ||
* CCmp related | ||
* | ||
* @author yanhom | ||
* @since 1.1.0 | ||
*/ | ||
@Component("c") | ||
public class CCmp extends NodeComponent { | ||
|
||
@Override | ||
public void process() { | ||
//do your business | ||
} | ||
} | ||
|
46 changes: 46 additions & 0 deletions
46
...apter-liteflow/src/main/java/org/dromara/dynamictp/example/controller/TestController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.dromara.dynamictp.example.controller; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.dromara.dynamictp.example.service.BizService; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import javax.annotation.Resource; | ||
|
||
/** | ||
* TestController related | ||
* | ||
* @author yanhom | ||
* @since 1.1.0 | ||
*/ | ||
@Slf4j | ||
@RestController | ||
@SuppressWarnings("all") | ||
public class TestController { | ||
|
||
@Resource | ||
private BizService bizService; | ||
|
||
@GetMapping("/dtp-example-adapter/testLiteflow") | ||
public String testLiteflow() throws InterruptedException { | ||
bizService.testConfig(); | ||
return "success"; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...mple-adapter-liteflow/src/main/java/org/dromara/dynamictp/example/service/BizService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.dromara.dynamictp.example.service; | ||
|
||
import com.yomahub.liteflow.core.FlowExecutor; | ||
import com.yomahub.liteflow.flow.LiteflowResponse; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.stereotype.Service; | ||
|
||
import javax.annotation.Resource; | ||
|
||
/** | ||
* BizService related | ||
* | ||
* @author yanhom | ||
* @since 1.1.0 | ||
*/ | ||
@Slf4j | ||
@Service | ||
public class BizService { | ||
|
||
@Resource | ||
private FlowExecutor flowExecutor; | ||
|
||
public void testConfig(){ | ||
LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); | ||
log.info("response:{}", response); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
example/example-adapter/example-adapter-liteflow/src/main/resources/application.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
server: | ||
port: 9119 | ||
|
||
liteflow: | ||
rule-source: config/flow.el.xml | ||
|
||
spring: | ||
application: | ||
name: dynamic-tp-adapter-liteflow-demo | ||
profiles: | ||
active: dev | ||
|
||
dynamic: | ||
tp: | ||
enabled: true | ||
enabledCollect: true # 是否开启监控指标采集,默认false | ||
collectorTypes: logging # 监控数据采集器类型(logging | micrometer | internal_logging),默认micrometer | ||
monitorInterval: 5 | ||
liteflowTp: # 通知报警平台配置 | ||
- threadPoolName: liteflowTp#LiteFlowDefaultWhenExecutorBuilder | ||
corePoolSize: 10 | ||
maximumPoolSize: 20 | ||
keepAliveTime: 60 | ||
|
||
# 开启 SpringBoot Actuator Endpoint 暴露出DynamicTp指标接口 | ||
# 开启 prometheus 指标采集端点 | ||
management: | ||
metrics: | ||
export: | ||
prometheus: | ||
enabled: true | ||
endpoints: | ||
web: | ||
exposure: | ||
include: '*' # 测试使用,线上不要用*,按需开启 |
6 changes: 6 additions & 0 deletions
6
example/example-adapter/example-adapter-liteflow/src/main/resources/config/flow.el.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<flow> | ||
<chain name="chain1"> | ||
WHEN(a, b, c); | ||
</chain> | ||
</flow> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.dromara.dynamictp</groupId> | ||
<artifactId>dynamic-tp-starter-adapter</artifactId> | ||
<version>${revision}</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
<artifactId>dynamic-tp-spring-boot-starter-adapter-liteflow</artifactId> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.dromara.dynamictp</groupId> | ||
<artifactId>dynamic-tp-spring-boot-starter-adapter-common</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.dromara.dynamictp</groupId> | ||
<artifactId>dynamic-tp-adapter-liteflow</artifactId> | ||
</dependency> | ||
</dependencies> | ||
</project> |
Oops, something went wrong.