Git Product home page Git Product logo

Comments (4)

Redick01 avatar Redick01 commented on May 18, 2024

你的问题是通过@bean方式创建线程池并且通过@Autowired方式使用并不会被监控和动态配置吧?如果这样的话可以参考下正确的使用方式:

public static void main(String[] args) {
DtpExecutor dtpExecutor = DtpRegistry.getExecutor("dynamic-tp-test-1");
dtpExecutor.execute(() -> System.out.println("test"));
}

@bean方式创建的线程池会被配置文件覆盖

from dynamic-tp.

yanhom1314 avatar yanhom1314 commented on May 18, 2024

目前是这样的,框架自己定义了个容器存储通过配置文件创建的Executor对象,没有注册到spring容器中,需要通过DtpRegistry.getExecutor("dynamic-tp-test-1")这样获取,当然也可以注册到spring中,通过依赖注入使用,后续可以考虑加上

from dynamic-tp.

yueming158 avatar yueming158 commented on May 18, 2024

目前是这样的,框架自己定义了个容器存储通过配置文件创建的Executor对象,没有注册到spring容器中,需要通过DtpRegistry.getExecutor("dynamic-tp-test-1")这样获取,当然也可以注册到spring中,通过依赖注入使用,后续可以考虑加上

好的,谢谢解答

from dynamic-tp.

yanhom1314 avatar yanhom1314 commented on May 18, 2024

目前是这样的,框架自己定义了个容器存储通过配置文件创建的Executor对象,没有注册到spring容器中,需要通过DtpRegistry.getExecutor("dynamic-tp-test-1")这样获取,当然也可以注册到spring中,通过依赖注入使用,后续可以考虑加上

好的,谢谢解答

已支持依赖注入方式使用

from dynamic-tp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.