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
    • 📙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文档
  • 🎨Advanced features
铂赛东
2022-07-03

🧁Custom request id

LiteFlow supports customizing your request Id.

When you execute a process, you can often see the following similar information in the log information:

2022-07-03 11:15:00.196  INFO 71275 --- [           main] com.yomahub.liteflow.flow.element.Node   : [067a0baa6d434de3a8ccafa4b1506562]:[O]start component[a] execution
2022-07-03 11:15:00.204  INFO 71275 --- [           main] com.yomahub.liteflow.flow.element.Node   : [067a0baa6d434de3a8ccafa4b1506562]:[O]start component[b] execution
2022-07-03 11:15:00.218  INFO 71275 --- [lf-when-thead-0] com.yomahub.liteflow.flow.element.Node   : [067a0baa6d434de3a8ccafa4b1506562]:[O]start component[c] execution
2022-07-03 11:15:00.220  INFO 71275 --- [lf-when-thead-1] com.yomahub.liteflow.flow.element.Node   : [067a0baa6d434de3a8ccafa4b1506562]:[O]start component[d] execution
2022-07-03 11:15:00.220  INFO 71275 --- [           main] com.yomahub.liteflow.slot.Slot           : [067a0baa6d434de3a8ccafa4b1506562]:CHAIN_NAME[chain1]
a<1>==>b<0>==>c<0>==>d<0>
2022-07-03 11:15:00.221  INFO 71275 --- [           main] com.yomahub.liteflow.slot.DataBus        : [067a0baa6d434de3a8ccafa4b1506562]:slot[0] released

The first part of the log body is the RequestId, and the requestId in a request is the same, which is convenient for you to search the log.

The form of this requestId can also be customized.

All you need to do is declare a class and implement the RequestIdGenerator interface:

public class CustomRequestIdGenerator implements RequestIdGenerator {

    @Override
    public String generate() {
        return System.nanoTime();
    }
}

Then declare your class in the LiteFlow configuration file:

liteflow.request-id-generator-class=com.yomahub.liteflow.test.requestId.config.CustomRequestIdGenerator

tip

In general, LiteFlow has its own default Id generation rules. So in most cases you don't need to customize this Id generator specially.

Help us improve this document (opens new window)
last update: 2022/10/13, 00:02:27
🧇Printing details
🌭Multiple type rules

← 🧇Printing details 🌭Multiple type rules→

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