Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-3957

Temporary queues are not being garbage collected. (unit test included)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Not A Problem
    • 5.6.0
    • None
    • None

    Description

      Temporary queues are not being garbage collected even if garbage collection is specified in destination policy.

      To reproduce:
      Add the following unit test to DetinationGCTest:

          public void testTempQueueGc() throws Exception {
              assertEquals(1, broker.getAdminView().getTemporaryQueues().length);
              assertTrue("After GC runs temporary queue should be deleted.", Wait.waitFor(new Condition() {
                  @Override
                  public boolean isSatisified() throws Exception {
                      return broker.getAdminView().getTemporaryQueues().length == 0;
                  }
              }));
          }
      

      And in createBroker() method change the setDestinations line to:

      broker.setDestinations(new ActiveMQDestination[] {queue, new ActiveMQTempQueue("TEMP-QUEUE")});
      

      Workaround:
      set broker.setAllowTempAutoCreationOnSend(true); however I'd expect the temp queues to be GCd without this setting.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ajermakovics Andrejs Jermakovics
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: