I'm trying to setup a STOMP endpoint in Java, using the embedded ActiveMQ Artemis.
My server goes up and accepts my Dart client connection, but then the connection times out and the cycle repeats forever.
This is my server code:
EmbeddedActiveMQ server = new EmbeddedActiveMQ();
org.apache.activemq.artemis.core.config.Configuration config = new org.apache.activemq.artemis.core.config.impl.ConfigurationImpl();
config.addAcceptorConfiguration("in-vm", "vm://0");
config.addAcceptorConfiguration("stomp", "tcp://0.0.0.0:61616?protocols=stomp");
config.setSecurityEnabled(false);
config.setPersistenceEnabled(false);
server.setConfiguration(config);
server.start()
Am I missing anything in my configuration?
This is the timed out log:
[Thread-0 (ActiveMQ-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$6@2b82c43a)] WARN org.apache.activemq.artemis.core.client [] - AMQ212037: Connection failure to /192.168.1.164:46478 has been detected: AMQ229014: Did not receive data from /192.168.1.164:46478 within the 60,000ms connection TTL. The connection will now be closed. [code=CONNECTION_TIMEDOUT]
The configuration of the embedded broker looks fine and the fact that it is able to accept a connection from a STOMP client suggests that it is working.
However, the timeout error you're seeing (i.e. AMQ229014
) indicates that the client is not actually using the connection and therefore the broker is closing it. I recommend you ensure heartbeats are being sent from your client to the broker in order to keep the connection alive when there's no actual messaging activity.
To confirm that the broker is actually receiving the heartbeat packets you can enable STOMP debug logging as described in the ActiveMQ Artemis documentation.