Hi,
If I run this simple code in a JUnit test:
runBlocking {
async{
LOGGER.warn("hello")
}
}
I can see that a lightweight thread is being used:
16:01:53.455 [ForkJoinPool.commonPool-worker-9 @coroutine#2] WARN MyClass - hello
However, exactly the same code run in a WAR file in a Tomee server:
16:01:09.030 [ForkJoinPool.commonPool-worker-9] WARN MyClass - hello
Is there is something I am missing? How can I know whether coroutine “threads” are used or not?
(logback configuration for both):
<configuration debug="false" reload="true">
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator"/>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %X{travelc.userId} %X{travelc.websessionid} %-5level %logger{50} - %msg%n</pattern>
</encoder>
</appender>
<root level="warn">
<appender-ref ref="STDOUT" />
</root>
</configuration>