Affects: \
Hi, I'm using Spring STOMP with ActiveMQ Artemis as external broker, and the client uses SockJS and webstomp-client to connect to the server. The connection works fine in a few minutes until an AMQ error threw out, which is
ERROR
message:AMQ229014\c Did not receive data from 127.0.0.1:19598 within the 20,000ms connection TTL. The connection will now be closed.
Then, I enabled the TRACE log, and found that It's the StompBrokerRelayMessageHandler stop forward heart-beat to Artemis, cause Artemis TTL timeout.
The trace log :
2023-04-19 11:57:11.911 TRACE 30364 --- [ent-scheduler-3] o.s.m.s.s.StompBrokerRelayMessageHandler : Received heart-beat in session _system_
2023-04-19 11:57:12.581 TRACE 30364 --- [nio-2240-exec-3] o.s.messaging.simp.stomp.StompDecoder : Decoded heart-beat
2023-04-19 11:57:12.582 TRACE 30364 --- [undChannel-1076] o.s.m.s.s.StompBrokerRelayMessageHandler : Forwarding heart-beat in session mvreoy3j
2023-04-19 11:57:12.582 TRACE 30364 --- [undChannel-1076] o.s.messaging.simp.stomp.StompEncoder : Encoding heartbeat
2023-04-19 11:57:21.890 TRACE 30364 --- [ent-loop-nio-11] o.s.messaging.simp.stomp.StompDecoder : Decoded heart-beat
2023-04-19 11:57:21.891 TRACE 30364 --- [nt-scheduler-10] o.s.m.s.s.StompBrokerRelayMessageHandler : Received heart-beat in session mvreoy3j
2023-04-19 11:57:21.891 TRACE 30364 --- [oundChannel-459] o.s.messaging.simp.stomp.StompEncoder : Encoding heartbeat
2023-04-19 11:57:21.922 TRACE 30364 --- [ient-loop-nio-2] o.s.messaging.simp.stomp.StompEncoder : Encoding heartbeat
2023-04-19 11:57:21.922 TRACE 30364 --- [ient-loop-nio-2] o.s.messaging.simp.stomp.StompDecoder : Decoded heart-beat
2023-04-19 11:57:21.922 TRACE 30364 --- [ent-scheduler-3] o.s.m.s.s.StompBrokerRelayMessageHandler : Received heart-beat in session _system_
2023-04-19 11:57:22.580 TRACE 30364 --- [io-2240-exec-10] o.s.messaging.simp.stomp.StompDecoder : Decoded heart-beat
2023-04-19 11:57:22.581 TRACE 30364 --- [undChannel-1079] o.s.m.s.s.StompBrokerRelayMessageHandler : Forwarding heart-beat in session mvreoy3j
2023-04-19 11:57:22.581 TRACE 30364 --- [undChannel-1079] o.s.messaging.simp.stomp.StompEncoder : Encoding heartbeat
2023-04-19 11:57:31.902 TRACE 30364 --- [ent-loop-nio-11] o.s.messaging.simp.stomp.StompDecoder : Decoded heart-beat
2023-04-19 11:57:31.902 TRACE 30364 --- [nt-scheduler-10] o.s.m.s.s.StompBrokerRelayMessageHandler : Received heart-beat in session mvreoy3j
2023-04-19 11:57:31.903 TRACE 30364 --- [oundChannel-460] o.s.messaging.simp.stomp.StompEncoder : Encoding heartbeat
2023-04-19 11:57:31.934 TRACE 30364 --- [ient-loop-nio-2] o.s.messaging.simp.stomp.StompEncoder : Encoding heartbeat
2023-04-19 11:57:31.934 TRACE 30364 --- [ient-loop-nio-2] o.s.messaging.simp.stomp.StompDecoder : Decoded heart-beat
2023-04-19 11:57:31.934 TRACE 30364 --- [ent-scheduler-3] o.s.m.s.s.StompBrokerRelayMessageHandler : Received heart-beat in session _system_
2023-04-19 11:57:41.904 TRACE 30364 --- [ent-loop-nio-11] o.s.messaging.simp.stomp.StompDecoder : Decoded heart-beat
2023-04-19 11:57:41.905 TRACE 30364 --- [nt-scheduler-10] o.s.m.s.s.StompBrokerRelayMessageHandler : Received heart-beat in session mvreoy3j
2023-04-19 11:57:41.905 TRACE 30364 --- [oundChannel-461] o.s.messaging.simp.stomp.StompEncoder : Encoding heartbeat
2023-04-19 11:57:41.936 TRACE 30364 --- [ient-loop-nio-2] o.s.messaging.simp.stomp.StompEncoder : Encoding heartbeat
2023-04-19 11:57:41.936 TRACE 30364 --- [ient-loop-nio-2] o.s.messaging.simp.stomp.StompDecoder : Decoded heart-beat
2023-04-19 11:57:41.936 TRACE 30364 --- [ent-scheduler-3] o.s.m.s.s.StompBrokerRelayMessageHandler : Received heart-beat in session _system_
2023-04-19 11:57:43.699 TRACE 30364 --- [ent-loop-nio-11] o.s.messaging.simp.stomp.StompDecoder : Decoded ERROR {message=[AMQ229014: Did not receive data from /127.0.0.1:20319 within the 20,000ms connection TTL. The connection will now be closed.]} session=null
2023-04-19 11:57:43.699 ERROR 30364 --- [nt-scheduler-10] o.s.m.s.s.StompBrokerRelayMessageHandler : Received ERROR {message=[AMQ229014: Did not receive data from /127.0.0.1:20319 within the 20,000ms connection TTL. The connection will now be closed.]} session=mvreoy3j, user=f646b604-a34e-4886-ba70-67f6a577531b
We can see in the latest two heartbeat, there is no forward log. My broker config is:
@Override
public void configureMessageBroker(MessageBrokerRegistry config) {
config.setApplicationDestinationPrefixes(DESTINATION_PREFIX);
var taskScheduler = new ThreadPoolTaskScheduler();
taskScheduler.setPoolSize(1);
taskScheduler.initialize();
config.enableStompBrokerRelay(NOTIFICATION_TOPIC, SERVER_EVENTS_TOPIC)
.setRelayHost("localhost")
.setRelayPort(artemisPortSupplier().get())
.setTaskScheduler(taskScheduler)
.setUserDestinationBroadcast(SERVER_EVENTS_TOPIC)
.setUserDestinationBroadcast(NOTIFICATION_TOPIC);
}
Without set the task scheduler, the error still happen. So, I'm wondering if this is a bug or a problem in my code?
Comment From: snicoll
It's really hard for us to say. It could be something related to the environment or a third party lib that you're using. If you want support, please take the time to share a small sample that we can run ourselves. Code snippet like that don't provide enough information (in particular the version of Artemis that you uses, etc).
You can share the project with us by attaching a zip to this issue or pushing the code to a GitHub repository.
Comment From: spring-projects-issues
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Comment From: spring-projects-issues
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.