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 <javaxmlsoap...@yahoo.com> 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: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/