Skip to content

Commit 53ff2de

Browse files
smartandhandsomephilwebb
authored andcommitted
Use Threading for virtual thread support
See gh-46404 Signed-off-by: Sangmin Park <[email protected]>
1 parent 7098c8e commit 53ff2de

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

module/spring-boot-reactor/src/main/java/org/springframework/boot/reactor/ReactorEnvironmentPostProcessor.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import org.springframework.boot.SpringApplication;
2020
import org.springframework.boot.env.EnvironmentPostProcessor;
21-
import org.springframework.boot.system.JavaVersion;
21+
import org.springframework.boot.thread.Threading;
2222
import org.springframework.core.Ordered;
2323
import org.springframework.core.env.ConfigurableEnvironment;
2424
import org.springframework.util.ClassUtils;
@@ -56,8 +56,7 @@ public void postProcessEnvironment(ConfigurableEnvironment environment, SpringAp
5656
}
5757
}
5858
}
59-
if (environment.getProperty("spring.threads.virtual.enabled", boolean.class, false)
60-
&& JavaVersion.getJavaVersion().isEqualOrNewerThan(JavaVersion.TWENTY_ONE)) {
59+
if (Threading.VIRTUAL.isActive(environment)) {
6160
System.setProperty("reactor.schedulers.defaultBoundedElasticOnVirtualThreads", "true");
6261
}
6362
}

0 commit comments

Comments
 (0)