You can have a mock route that is a consumer of the DLQ just as you would
have a mock route for the happy path.  Here is a short example:

from("seda:start")
  .choice()
    .when(header("type").isEqualTo("A"));
      .to("direct:end")
    .otherwise()
      .to("direct:my.DLQ")
.routeId("myRoute");

from("direct:end")
      .to("mock:end.result");

from("direct:my.DLQ")
      .to("mock:my.DLQ.result");


Then write your happy path test for the mock:end.result endpoint and your
unhappy path test for the mock:my.DLQ.result.

Make sense?

On Fri, Nov 30, 2012 at 11:17 AM, tolk <[email protected]> wrote:

> Cheers, that's very helpful. I have another related question;
>
> I want to unit test my actual dead letter queue, whats the easiest way to
> mock a broken communication to demonstrate this?
>
> Thanks again.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Dead-letter-queue-when-header-not-matched-tp5723462p5723466.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
-- 
Scott England-Sullivan
Apache Camel Committer
Principal Consultant / Sr. Architect | Red Hat, Inc.
FuseSource is now part of Red Hat
Web:     fusesource.com <http://www.fusesource.com> |
redhat.com<http://www.redhat.com>
Blog:     sully6768.blogspot.com
Twitter: sully6768

Reply via email to