smart-flow v1.1.3 released to optimize user experience & adapt to Nacos

1. Introduction to smart-flow

smart-flow is a lightweight and flexible business process orchestration framework that supports common conditional branch control, sub-processes, business component asynchronous and degradation functions in business processes. At the same time, smart-flow is also an observable process orchestration framework. Functions such as process structure topology, execution path tracking, and link analysis can help you gain insight into the entire business process and execution.

smartboot open source organization, a low-key organization that is easily mistaken for "reinventing the wheel". Won the honor of "Excellent Gitee Organization" of OSC China Open Source Project in 2020 . 

Star projects within the organization include:

  • smart-socket
    took 5 years to refine more than 2,000 lines of code, and easily realize the AIO communication framework with millions of long connections.

  • smart-http
    is an HTTP/1.1 web service based on smart-socket.

  • smart-servlet
    is based on the Servlet 3.1 container service implemented by smart-http.

  • smart-mqtt

    MQTT 3.1.1/5.0 Broker&Client service implemented based on smart-socket.
  • smart-flow
    is a lightweight business orchestration framework with observability.

Organization address: https://smartboot.tech/
Code repository: https://gitee.com/smartboot

2. Version update

The v1.1.3 version update is mainly to optimize some user experience, and also added nacos integration.

The specific content features are as follows:

 

Faster way to interrupt process

Before version 1.1.3, the process must be interrupted through the context, which may be inconvenient to use in practice. Based on this, the new tool class static method can directly interrupt the process.

EngineContextHelper.broken(); // 中断当前流程/子流程
EngineContextHelper.brokenAll(); // 中断整个流程

 

traceReporter optimization

In this update, the original is traceReportersplit into traceCollectora new one traceReporter. It is responsible collectorfor collecting traceand reporting to the remote end.reportertrace

// 配置reporter
HttpTraceReporter reporter = new HttpTraceReporter();
reporter.setServerAddress("http://localhost:8099/");
reporter.setTimeout(4000L);
reporter.setHeaders(new HashMap<>());

reporter.getHeaders().put("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)");
reporter.init();

// 配置收集器
DefaultTraceCollector collector = new DefaultTraceCollector();
collector.setRadio(0.1); // 设置采样率
collector.addReporter(reporter); // 添加traceReporter
collector.start();  // 启动收集器

 

Spring usage optimization

  • placeholder support

When setting attributes for component tags, placeholders are supported , and the parsing and attribute setting of placeholders will be handled by spring.${}

<flow:component name="${engine.name}" execute="itemComponent" 
   degradable="${itemComponent.degradable:false}"/>
  • Automatic bean loading

Some classes in the spring extension package will be automatically registered in the spring container, no longer need to be manually introduced.

 

Springboot usage optimization

It mainly optimizes the assembly of some beans in the springboot environment, and adds the assembly function of link reporting. For details, see Integrating springboot .

 

Nacos integration

Pull the engine configuration analysis from Nacos remotely, and support configuration change monitoring, and regenerate the engine instance according to the changed configuration.

<dependency>
    <groupId>org.smartboot.flow</groupId>
    <artifactId>smart-flow-integration-nacos</artifactId>
    <version>${lastest.version}</version>
</dependency>

Read more: Integrating nacos

 

other updates

  • 【Optimization】Removal methodDefaultEngineManager#getDefaultEngineManager
  • [New] Add engine acquisition methodEngineManager#getEngine
  • [Optimization] Other code optimization


 

3. How to use smart-flow

3.1 Source code

3.2 Maven dependencies

  • smart-flow-core core package, can be used alone
<dependency>
    <groupId>org.smartboot.flow</groupId>
    <artifactId>smart-flow-core</artifactId>
    <version>1.1.3</version>
</dependency>
  • smart-flow-spring-extension spring extension
<dependency>
      <groupId>org.smartboot.flow</groupId>
      <artifactId>smart-flow-spring-extension</artifactId>
      <version>1.1.3</version>
  </dependency>
  • smart-flow-manager management package
<dependency>
      <groupId>org.smartboot.flow</groupId>
      <artifactId>smart-flow-manager</artifactId>
      <version>1.1.3</version>
  </dependency>

3.3 use

Click to view quick access

3.4. Example address

demo project address

Management console experience address

Guess you like

Origin www.oschina.net/news/253723/smart-flow-1-1-3-released