activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john <>
Subject unit test with expired advisory
Date Tue, 14 Jun 2011 15:26:51 GMT

I'm using activemq version 5.3.1

I have successfully integrated a route in my camel application that monitors
an expired message advisory queue. The problem I'm having is trying to
create a unit test for my scenario. It seems like no matter what timeToLive
I pass in, receiving the expired advisory is inconsistent.

I've tried to pull everything out of my route to create a simple expired
advisory unit test. My test creates one route that listens on the expired
advisory queue and forward any messages to a second queue (ExpiredQueue).

My test class is below. If anyone has any thoughts as to why this unit test
doesn't work, please let me know!

    public void oneExpires() throws Exception
        MockEndpoint mockResult = getMockEndpoint("mock:result");

        RouteDefinition routeUnderTest =
        routeUnderTest.adviceWith(new RouteBuilder()

            public void configure() throws Exception

        ProducerTemplate producer = context.createProducerTemplate();
        producer.sendBody("activemq:queue:TestQueue?timeToLive=1000", "hi



View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message