File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/main/java/com/rabbitmq/stream/impl Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -28,13 +28,18 @@ final class ThreadUtils {
2828
2929 private static final Logger LOGGER = LoggerFactory .getLogger (ThreadUtils .class );
3030
31+ static final boolean VIRTUAL_THREADS_ON =
32+ Boolean .parseBoolean (System .getProperty ("rabbitmq.stream.threads.virtual.enabled" , "false" ));
33+
3134 private static final ThreadFactory THREAD_FACTORY ;
3235 private static final Predicate <Thread > IS_VIRTUAL ;
3336
3437 static {
3538 ThreadFactory tf ;
36- if (isJava21OrMore ()) {
37- LOGGER .debug ("Running Java 21 or more, using virtual threads" );
39+ LOGGER .debug ("Virtual threads enabled: {}" , VIRTUAL_THREADS_ON );
40+ LOGGER .debug ("Java 21 or more: {}" , isJava21OrMore ());
41+ if (VIRTUAL_THREADS_ON && isJava21OrMore ()) {
42+ LOGGER .debug ("Using virtual threads" );
3843 try {
3944 Class <?> builderClass =
4045 Arrays .stream (Thread .class .getDeclaredClasses ())
You can’t perform that action at this time.
0 commit comments