Uploaded image for project: 'AMQ Broker'
  1. AMQ Broker
  2. ENTMQBR-2876

OpenWire Consumers are Not Cleaned up When the Session is Closed but Connection Remains Open

XMLWordPrintable

    • +
    • Hide
      Previously, if an OpenWire client closed a session without closing associated consumers, the consumers were not cleaned up by the broker. Even if the client exited, an `OpenWireConnection` object remained on the broker with a potentially large collection in `OpenWireConnection.consumerExchanges`. Over time, this situation exhausted the broker heap space and the broker entered an out-of-memory (OOM) state. This issue is now resolved.
      Show
      Previously, if an OpenWire client closed a session without closing associated consumers, the consumers were not cleaned up by the broker. Even if the client exited, an `OpenWireConnection` object remained on the broker with a potentially large collection in `OpenWireConnection.consumerExchanges`. Over time, this situation exhausted the broker heap space and the broker entered an out-of-memory (OOM) state. This issue is now resolved.
    • Documented as Resolved Issue
    • Verified in a release
    • Hide
      • Start the artemis broker
      • Run the attached pojo client example "MyConsumer" class (on the same host)
      • Capture a heap dump of the broker
      • Run an OQL query to pull up the OpenWire connections:
        select * from org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection owc
      • sort the connections by size and examine the consumerExchanges map under the largest connection object(s)
      • You will see 1000 items in the table, even though the session is closed

      I am also attaching a spring-boot camel application using the bitronix XA provider that demonstrates the same behavior. If the application is started, allowed to connect and consume messages and stopped repeatedly, a buildup of consumers occurs in the broker that persists even if the spring-boot app is shut down.

      Show
      Start the artemis broker Run the attached pojo client example "MyConsumer" class (on the same host) Capture a heap dump of the broker Run an OQL query to pull up the OpenWire connections: select * from org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection owc sort the connections by size and examine the consumerExchanges map under the largest connection object(s) You will see 1000 items in the table, even though the session is closed I am also attaching a spring-boot camel application using the bitronix XA provider that demonstrates the same behavior. If the application is started, allowed to connect and consume messages and stopped repeatedly, a buildup of consumers occurs in the broker that persists even if the spring-boot app is shut down.

      If an OpenWire client closes a session without closing associated consumers, the consumers are not cleaned up on the broker side. Even if the client exits, we can see an OpenWireConnection object remaining on the broker with a potentially large collection in OpenWireConnection.consumerExchanges. Over time this exhausts the broker heap space and the broker goes OOM.

            gaohoward Howard Gao
            rhn-support-dhawkins Duane Hawkins
            Mikhail Krutov Mikhail Krutov
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: