Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-9102

[cxf] JMS transport does not clean up resources properly in case of an JMSException

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Done
    • jboss-fuse-6.3
    • fuse-7.1
    • CXF
    • Fuse 7.1 Sprint 31
    • Hide
      • Save attached test case into a CXF distribution under folder samples/
      • Extract attached test case and build it
      • Run ActiveMQ broker (non-Karaf) with activemq.xml contained in attached test case
        ./activemq console xbean:file:/path/to/activemq.xml
      • Use any tool to send at least 1MB of messages to a destination of your choice except test.queue, until you hit the error
        Persistent store is Full, 100% of 1048576.
        This ensures the brokers store is full and it won't accept any more messages.
      • Run the test case using mvn -Pclient
      Show
      Save attached test case into a CXF distribution under folder samples/ Extract attached test case and build it Run ActiveMQ broker (non-Karaf) with activemq.xml contained in attached test case ./activemq console xbean: file:/path/to/activemq.xml Use any tool to send at least 1MB of messages to a destination of your choice except test.queue , until you hit the error Persistent store is Full, 100% of 1048576. This ensures the brokers store is full and it won't accept any more messages. Run the test case using mvn -Pclient

    Description

      Consider a broker that is configured for

       <systemUsage>
        <systemUsage sendFailIfNoSpace="true">
        ...
      </systemUsage>
      

      and raises an exception in case the persistence store is full.

      Now, when using a CXF client with JMS transport and request/reply communication, the broker may raise an JMSException in case it cannot take any more message because the store is full.

      While the exception is caught and handled in org.apache.cxf.transport.jms.JMSConduit.sendExchange():

                  if (exchange.isOneWay()) {
                      sendMessage(request, outMessage, null, null, closer, session);
                  } else {
                      sendAndReceiveMessage(exchange, request, outMessage, closer, session);
                  }
              } catch (JMSException e) {
                  // Close connection so it will be refreshed on next try
      -->       ResourceCloser.close(connection);
                  this.connection = null;
                  this.staticReplyDestination = null;
      

      and CXF tries to close the JMS connection, this call will fail with this message

      INFO: failed to delete Temporary Queue "temp-queue://ID:Mac.fritz.box-58171-1529310181545-1:1:1" on closing pooled connection: A consumer is consuming from the temporary destination
      

      It fails because the call to ActiveMQConnection.close(), first tries to delete any temporary destinations. These however cannot be deleted because there is still a consumer registered on this temp destination. Hence above message.

      The ActiveMQConnection remains open, the temp destination is not cleared either but remains registered under the ActiveMQConnection.

      Attachments

        1. CustomerServiceTester.java
          4 kB
          Torsten Mielke
        2. jms_spring_config-ENTESB-9102.tgz
          12 kB
          Torsten Mielke
        3. Screen Shot 2018-06-20 at 3.45.13 PM.png
          140 kB
          Freeman(Yue) Fang

        Issue Links

          Activity

            People

              yfang@redhat.com Freeman(Yue) Fang
              rhn-support-tmielke Torsten Mielke
              Viliam Kasala Viliam Kasala
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: