Hi The file component has a move and movedFailed option you can use http://camel.apache.org/file2
On Fri, Mar 21, 2014 at 9:05 PM, a106562 <a106...@drdrb.net> wrote: > Hello community, > > I have the following algorithm > > 1. Incoming message. > 2. Fetch an object from db or remote service, which should be updated with > information from parsed message. Parsing may be complex > a) if the object is not available, then create an new one and save it > into db. Notify user about new object. Move Message into .errors folder. > Stop Processing message. > b) if the object is available, then update it and save. If some > properties are invalid stop processing. Move Message into .errors folder. > 3. Fetch or create another object which should be processed with similar > logic like in step 2. But using remote web service > 4. if one of steps fails with an Exception, then move original message into > .errors folder, otherwise copy into backup folder and .done folder > > To be able to move/copy the input message from step 1, I've saved it into > properties. Then, for moving message at the end of each 'if' branch, I do > > setBody(property("input")).to("file:afolder") > > > I wonder, if there are any better ways, patterns to implement the algorithm > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/moving-input-message-after-routing-ends-tp5749216.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. Email: cib...@redhat.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen Make your Camel applications look hawt, try: http://hawt.io