Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Hope that 'dubbo-spring-boot-starter' supports springboot's 'spring.threads.virtual.enabled' Virtual thread switch #15158

Open
3 of 4 tasks
JavaLionLi opened this issue Feb 18, 2025 · 7 comments
Labels
component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage

Comments

@JavaLionLi
Copy link
Contributor

Pre-check

  • I am sure that all the content I provide is in English.

Search before asking

  • I had searched in the issues and found no similar feature requirement.

Apache Dubbo Component

Java SDK (apache/dubbo)

Descriptions

Hope that 'dubbo spring boot starter' supports springboot's 'spring.threads.virtual.enabled' Virtual thread switch

spring.threads.virtual.enabled: true Start the virtual thread

Related issues

No response

Are you willing to submit a pull request to fix on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

@JavaLionLi JavaLionLi added component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage labels Feb 18, 2025
@JavaLionLi JavaLionLi changed the title [Feature] Hope that 'dubbo spring boot starter' supports springboot's 'spring.threads.virtual.enabled' Virtual thread switch [Feature] Hope that 'dubbo-spring-boot-starter' supports springboot's 'spring.threads.virtual.enabled' Virtual thread switch Feb 18, 2025
@AlbumenJ
Copy link
Member

Would you like to support it?

@JavaLionLi
Copy link
Contributor Author

Would you like to support it?

Image
Is it possible to omit this part of the configuration through the code, so that it can be turned on with one click
I'm not familiar with this work, but if I can crack this, I can try

@AlbumenJ
Copy link
Member

If spring.threads.virtual.enabled is configured, just apply the configuration to ProtocolConfig

@JavaLionLi
Copy link
Contributor Author

If spring.threads.virtual.enabled is configured, just apply the configuration to ProtocolConfig

Is it possible to add a new configuration to 'DubboDefaultPropertiesEnvironmentPostProcessor'?

@JavaLionLi
Copy link
Contributor Author

JavaLionLi commented Feb 20, 2025

If spring.threads.virtual.enabled is configured, just apply the configuration to ProtocolConfig

@Configuration
public class DubboConfig {
    @Bean
    public ExecutorService virtualThreadExecutor() {
        return Executors.newVirtualThreadPerTaskExecutor();
    }
}

Which class is better to add this code to. DubboAutoConfiguration ?

@JavaLionLi
Copy link
Contributor Author

Use dubbo 3.3.3 dubbo.protocol.executor this configuration is not found, and it is not in the code

@oxsean
Copy link
Collaborator

oxsean commented Feb 21, 2025

Good idea, I think if user set 'spring.threads.virtual.enabled' to true, means that the user wish to use the virtual thread pool by default.
If you have time, try it.

Some suggestions, you can refer to this method of reading the name and write to the configuration here.
https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot/src/main/java/org/apache/dubbo/spring/boot/env/DubboDefaultPropertiesEnvironmentPostProcessor.java#L72

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage
Projects
Status: Todo
Development

No branches or pull requests

3 participants