I am trying to test with:

    [EMAIL PROTECTED]({"startEndpointUri", "successEndpointUri",
"tapEndpointUri", "errorEndpointUri", "messageInputBody"})
    public void testReceiveValidStatusUpdateTimedout(String
startEndpointUri,
                                                     String
successEndpointUri,
                                                     String tapEndpointUri,
                                                     String
errorEndpointUri,
                                                     String messageInputBody
    )
            throws Exception {
        MockEndpoint mockSuccessEndpoint =
getMockEndpoint(successEndpointUri);
        MockEndpoint mockFailureEndpoint =
getMockEndpoint(errorEndpointUri);

        mockFailureEndpoint.expectedMessageCount(0);
        mockSuccessEndpoint.expectedMessageCount(1);

        try {
            // setup RouteBuilder...
            // Create and Send message to input queue
            camelContext.addRoutes(
                    createRoute(startEndpointUri,
                            statusUpdateProcessor,
                            tapEndpointUri,
                            successEndpointUri,
                            errorEndpointUri
                    )
            );

            // Create and Send message to input queue
            producerTemplate.sendBodyAndHeader(startEndpointUri,
messageInputBody, Constants.COMMAND_TYPE, Constants.JOB_STATUS);

            wait(2000); // my ttl is 1000

            Assert.fail("Should have thrown a ExchangeTimedOutException");
        } catch (RuntimeCamelException e) {
            assertIsInstanceOf(e, ExchangeTimedOutException.class);
        }

        testMocksAreValid();

        MockEndpoint.assertIsSatisfied(mockSuccessEndpoint,
/*mockTapEndpoint, */mockFailureEndpoint);
    }*

But I this error for my wait():

*<![CDATA[java.lang.IllegalMonitorStateException
    at java.lang.Object.wait(Native Method)
    at com.servepath.chan*
gerequest.StatusUpdateTest.testReceiveValidStatusUpdateTimedout(StatusUpdateTest.java:125)

I am trying to send a message to my *timoutQueue*, then if nobody picks up
the messages in xx seconds, send that message to the *deadLetterChannel*.





On Thu, Oct 2, 2008 at 2:48 AM, James Strachan <[EMAIL PROTECTED]>wrote:

> 2008/10/2 Mick Knutson <[EMAIL PROTECTED]>:
> > I am trying to send a message to a timeout queue:
> >
> > activemq:queue:channel/command/timeout?*timeToLive=40000*
> >
> > but what I want is for those messages to timeout after 4000 if they have
> not
> > been consumed, and send that message to a DeadLetterChannel.
> >
> > How can I do this, and how can I unit test this?
>
> The easiest way to solve this is to use the JMS providers Dead Letter
> handling of expired messages; so subscribe to the Dead Letter topic
> for expired messages on ActiveMQ.
>
> --
> James
> -------
> http://macstrac.blogspot.com/
>
> Open Source Integration
> http://open.iona.com
>



-- 
---
Thank You…

Mick Knutson
BASE Logic, inc.
(415) 354-4215

Website: http://baselogic.com
Blog: http://baselogic.com/blog
BLiNC Magazine: http://blincmagazine.com
Linked IN: http://linkedin.com/in/mickknutson
DJ Mick: http://djmick.com
MySpace: http://myspace.com/mickknutson
Vacation Rental: http://tahoe.baselogic.com

Reply via email to