Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

Chapter 9. Detecting dead connections


To prevent AMQ Broker from running out of system resources, it is necessary to clean up inactive server-side resources, which often remain when clients do not stop gracefully. You can configure the duration that AMQ Broker waits before it cleans up inactive server-side resources.

9.1. Detecting dead connections

During garbage collection, the broker identifies client connections that were not properly shut down. The broker closes each connection and writes a message to the log. The log shows the exact line of code where a client session was instantiated, which enables you to identify and correct the error.

The following is an example of a message written to the log for a client connection that was not properly shut down.

[Finalizer] 20:14:43,244 WARNING [org.apache.activemq.artemis.core.client.impl.DelegatingSession]  I'm closing a JMS Conection you left open. Please make sure you close all connections explicitly before let
ting them go out of scope!
[Finalizer] 20:14:43,244 WARNING [org.apache.activemq.artemis.core.client.impl.DelegatingSession]  The session you didn't close was created here:
java.lang.Exception
   at org.apache.activemq.artemis.core.client.impl.DelegatingSession.<init>(DelegatingSession.java:83)
   at org.acme.yourproject.YourClass (YourClass.java:666) //
Copy to Clipboard Toggle word wrap

Because the network connection between the client and the server can fail and then come back online, which allows a client to reconnect, AMQ Broker waits to clean up inactive server-side resources. This wait period is called a time to live (TTL). The default TTL for a network-based connection is 60000 milliseconds (1 minute). The default TTL on an in-VM connection is -1, which means the broker never times out the connection on the broker side.

9.2. Configuring a connection time to live on the broker

The duration the broker waits before it cleans up inactive server-side resources is called a time to live (TTL). If you do not want any TTL value set by clients to apply, you can set a global TTL value on the broker, along with the interval at which the broker checks for TTL violations.

Procedure

  1. Edit <broker_instance_dir>/etc/broker.xml by adding the connection-ttl-override configuration element and providing a value for the time to live, as in the example below.

    <configuration>
     <core>
      ...
      <connection-ttl-override>30000</connection-ttl-override> //
      <connection-ttl-check-interval>1000</connection-ttl-check-interval> //
      ...
     </core>
    </configuration>
    Copy to Clipboard Toggle word wrap
    connection-ttl-override
    The global TTL for all connections. In the example, the TTL is set to 30000 milliseconds. The default value is -1, which allows clients to set their own TTL.
    connection-ttl-check-interval
    The interval between checks for dead connections. In the example, the interval is set to 1000 milliseconds. By default, the checks are done every 2000 milliseconds.
Nach oben
Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2025 Red Hat