Can you just use the regular onException handlers? If there is an error
processing, throw an exception, and in the onException handler enrich with
a Failed header and create your new message and send to a queue.

On Saturday, July 20, 2013, Claus Ibsen wrote:

> Hi
>
> If its a new inbound message maybe you can use an intercept from and
> then do your check / whatever you want
> http://camel.apache.org/intercept
>
> On Tue, Jul 16, 2013 at 2:13 PM, al94781 <and...@harmel-law.com<javascript:;>>
> wrote:
> > Hi there,
> >
> > We have a situation in our route whereby, when we encounter an error in
> > processing an inbound message, we want to flag the original as "Failed"
> (in
> > a header) prior to further processing, and also generate a new message to
> > request a tidy up of resources the original failure may have left behind
> > which we put on a new request queue.
> >
> > The question I have is therefore: What is the canonical way to achieve
> this
> > with Camel?
> >
> >  - A splitter isn't the right way as the new (tidy up) message is not in
> the
> > original message to split it out.
> >  - A wiretap feels like it might be a possibility, (looking for messages
> > with a "Failed" header, and reacting as a result by creating the new
> > message) but I'm not clear if this can operate within the original
> > transaction (we can't lose messages, and want to ensure a failure at
> least
> > guarantees a clean up is attempted).
> >  - Alternatively we can just use a plain old processor, but this feels
> as if
> > we're missing something and a little ad-hoc.
> >
> > Can anyone help?  We're pretty sure this must be a very common use case.
> >
> > TIA
> >
> > Cheers, Andrew
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/Canonical-Way-to-Create-a-New-Message-Given-Certain-Conditions-tp5735721.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: cib...@redhat.com <javascript:;>
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>


-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta

Reply via email to