Spring Application Not Able to Communicate with Apache Artemis Configured on Another VM

Tai Li 40 Reputation points
2025-06-03T07:45:03.84+00:00

Hi,

I have a Spring application and is needed to communicate to Apache Artemis that I have configured on another VM. The following is the error message:

ERROR org.springframework.messaging.simp.stomp.StompBrokerRelayMessageHandler - Received ERROR {message=[AMQ229014: Did not receive data from x.x.x.x:<port> within the 20000ms connection TTL. The connection will now be closed.]}

Need advise on this.

Thank you.

Regards.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,019 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Obinna Ejidike 1,910 Reputation points
    2025-06-03T08:21:59.3166667+00:00

    Hi Tai Li

    Thanks for using the Q&A platform.

    The error suggests the Spring application lost the connection to Apache Artemis due to inactivity or network issues.

    Can you try telnet from the Spring app host?

    #Change the x.x.x.x to the Ip and also provide Artemis port number
    
    telnet x.x.x.x port
    
    

    If the telnet fails, it's likely a network or firewall issue.

    Also, ensure the Artemis server VM allows inbound traffic on the Artemis port:

    sudo ufw allow port number
    # or check with your cloud/vm firewall rules
    
    

    Lastly, you can try running tcpdump or Wireshark on the Artemis VM to ensure the packets are arriving from the Spring app host.

    You can mark it 'Accept Answer' and 'Upvote' if this helped you.

    Regards,

    Obinna.

    1 person found this answer helpful.

  2. Tai Li 40 Reputation points
    2025-06-11T03:45:46.1966667+00:00

    After further investigation, the cause for my spring application that is not able to perform the necessary action with the usage of Apache MQ is due to application user permission control. Sorry for the false alarm.

    With regards to this error message:

    ERROR org.springframework.messaging.simp.stomp.StompBrokerRelayMessageHandler - Received ERROR {message=[AMQ229014: Did not receive data from x.x.x.x:<port> within the 20000ms connection TTL. The connection will now be closed.]}

    I recall reading something like this:

    ActiveMQ Artemis has a default connection TTL of 60 seconds. If no data is exchanged within this period, it assumes the client is dead and closes the connection.

    I will either need to suppress this message or disable the 'heartbeat'.

    https://activemq.apache.org/components/artemis/documentation/latest/connection-ttl.html#detecting-failure-from-the-client

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.