[ 
https://issues.apache.org/jira/browse/AMQ-3957?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13427991#comment-13427991
 ] 

Andrejs Jermakovics commented on AMQ-3957:
------------------------------------------

Perhaps I'm missing something but it seems to happen if you create temporary 
queues dynamically:

{code}
 public void testTempQueueGc() throws Exception {
        createConnection().createSession(false, 
Session.AUTO_ACKNOWLEDGE).createTemporaryQueue();

        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;
            }
        }));
    }
{code}

{{allowTempAutoCreationOnSend=false}} and {{broker.setDestinations}} only has 
the normal queue

                
> Temporary queues are not being garbage collected. (unit test included)
> ----------------------------------------------------------------------
>
>                 Key: AMQ-3957
>                 URL: https://issues.apache.org/jira/browse/AMQ-3957
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.6.0
>            Reporter: Andrejs Jermakovics
>              Labels: garbage, inactivity, temp, unit-test
>
> 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}}:
> {code}
>     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;
>             }
>         }));
>     }
> {code}
> And in {{createBroker()}} method change the setDestinations line to:
> {code}
> broker.setDestinations(new ActiveMQDestination[] {queue, new 
> ActiveMQTempQueue("TEMP-QUEUE")});
> {code}
> *Workaround:*
> set {{broker.setAllowTempAutoCreationOnSend(true);}} however I'd expect the 
> temp queues to be GCd without this setting.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to