You could also check for messages in DLQ.[your-queue-name] since this
is often used as deadletterstrategy:
<individualDeadLetterStrategy
              queuePrefix="DLQ." useQueueForQueueMessages="true" />

If you find your message in there, you should check if you really work
with embedded broker. I had issues with two brokers as soon as I
declared one in spring-xml-config for testing since one is created
automatically when you use the vm-transport-protocol for your
amq-tests: http://activemq.apache.org/vm-transport-reference.html

For more suggestion I guess people have to see your route definition...

cheers
stefan


On Thu, Apr 26, 2012 at 12:57, Claus Ibsen <[email protected]> wrote:
> And you got a route that is properly setup to route from JMS -> and do
> some stuff.
> Mind that a message only goes into the AMQ if the message is *already*
> in the broker.
>
> Also mind that to use persistent queues to ensure messages is kept in
> the queues if there is no active consumers.
> And for unit testing to clear the amq data directory between tests so its 
> empty.
>
>
> On Wed, Apr 25, 2012 at 11:23 PM, javaxmlsoapdev
> <[email protected]> wrote:
>> Hello,
>>
>> I have a use case to pick up a message from source JMS queue and route it to
>> bunch of other JMS destination queues. In order to test transaction I have
>> followed Camel in Action, steps described in Chapter 9 (Using Transactions),
>> with embedded ActiveMQ etc. I have an interceptor like below.
>>
>> Endpoint sourceQendPoint = sourceQueue.getDefaultEndpoint();
>>                RouteBuilder rb = new RouteBuilder(){
>>                        public void configure() throws Exception{
>>                                
>> interceptSendToEndpoint("activemq:queue:destinationQueue1")
>>                                        .throwException(new 
>> JMSException("Cannot publish to
>> destinationQueue1"));
>>                        }
>>                };
>>
>> RouteDefinition customRoute = camelContext.getRouteDefinition("route1");
>>                customRoute.adviceWith((ModelCamelContext)camelContext, rb);
>>
>>                template.sendBody(sourceQendPoint ,"Message changed");
>>                Thread.sleep(3000);
>>                //"activemq:queue:ActiveMQ:DLQ"
>>                Object body = 
>> consumer.receiveBodyNoWait("activemq:queue:ActiveMQ.DLQ");
>> assertNotNull("should not lose message",body);
>>
>> This assert doesn't work. Dead letter queue is empty as well.
>>
>> Anything that I may have missed in setting this test case up?
>>
>> --
>> View this message in context: 
>> http://camel.465427.n5.nabble.com/Transacted-test-case-with-ActiveMQ-not-working-tp5666012p5666012.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
> FuseSource
> Email: [email protected]
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to