Code Monkey home page Code Monkey logo

Comments (3)

yanhom1314 avatar yanhom1314 commented on August 29, 2024

没有配置spi?

from dynamic-tp.

dbige avatar dbige commented on August 29, 2024

感谢您的回复,我没有理解你的意思? spi 配置是做什么配置呢? 我没有使用配置中心的动态线程池,而是使用框架案例中@bean方式生成的线程池,

ThreadPoolBuilder.newBuilder()
     .rejectedExecutionHandler(rejectPolicy)
   剩余配置省略

然后该配置与 dtpLifecycle 类自动配置相关有冲突报错截取如下

org.springframework.context.ApplicationContextException: Failed to start bean 'dtpLifecycle'; nested exception is org.dromara.dynamictp.common.ex.DtpException: Cannot find specified rejectedHandler CustomRejectPolicy
	at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:185)
	at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:53)
	at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:360)
	at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:158)
	at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:122)
	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:895)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:554)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
	at com.pec.retail.mdc.MdcServiceApplication.main(MdcServiceApplication.java:23)
Caused by: org.dromara.dynamictp.common.ex.DtpException: Cannot find specified rejectedHandler CustomRejectPolicy

从报错上看应该是框架没法找到我自定义的拒绝策略CustomRejectPolicy ,上文有述说过不在赘述.
我太理解我还要做特殊配置,调用api去修改?还是我遗漏了什么?
我没在官网的举例中找到自定义拒绝策略的相关配置,如果有的话能否提供下举例截图,或者相关路径,感谢

from dynamic-tp.

KamToHung avatar KamToHung commented on August 29, 2024

ExtensionServiceLoader

https://dynamictp.cn/guide/notice/custom.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E9%80%9A%E7%9F%A5%E6%B8%A0%E9%81%93 可以参考这个,resources/META-INF/services 下配置 java spi 实现

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.