Add channel to the WebsocketConsumerServerHandler.CHANNELS before handshake
In attempt to fix a race condition in the tests * Remove `log4j` deps as redundant: Spring Boot brings them anyway for logback compatibility * Add `logback-test.xml` to the `spring-websocket-consumer.test` for test race condition failures
This commit is contained in:
@@ -140,9 +140,6 @@ configure(javaProjects) { subproject ->
|
||||
testImplementation 'org.awaitility:awaitility'
|
||||
testImplementation 'org.testcontainers:junit-jupiter'
|
||||
|
||||
testRuntimeOnly 'org.apache.logging.log4j:log4j-core'
|
||||
testRuntimeOnly 'org.apache.logging.log4j:log4j-jcl'
|
||||
|
||||
// NOTE: We explicitly specify checkstyle dep before javaformat checkstyle due to antlr class mismatch
|
||||
checkstyle("com.puppycrawl.tools:checkstyle:${checkstyle.toolVersion}")
|
||||
checkstyle("io.spring.javaformat:spring-javaformat-checkstyle:${javaFormatVersion}")
|
||||
|
||||
@@ -120,8 +120,8 @@ public class WebsocketConsumerServerHandler extends SimpleChannelInboundHandler<
|
||||
WebSocketServerHandshakerFactory.sendUnsupportedVersionResponse(ctx.channel());
|
||||
}
|
||||
else {
|
||||
this.handshaker.handshake(ctx.channel(), req);
|
||||
WebsocketConsumerServer.CHANNELS.add(ctx.channel());
|
||||
this.handshaker.handshake(ctx.channel(), req);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<configuration>
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
<root level="DEBUG">
|
||||
<appender-ref ref="STDOUT" />
|
||||
</root>
|
||||
<logger name="org.springframework" level="DEBUG" />
|
||||
</configuration>
|
||||
Reference in New Issue
Block a user