camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: Custom log messages
Date Tue, 16 Sep 2008 16:13:56 GMT
2008/9/16 raulvk.soa <raulvk.soa@gmail.com>:
>
> Hi,
>
> Just a contribution.
>
> I think a good verb for this action would be "branch". Correct me if I am
> wrong, but what you are actually doint is spawning a new thread that would
> do some further processing on a copy of the initial message, and once the
> thread is done, the Exchange object associated with it would be scrapped
> away. In the parallel, the main processing flow would continue within the
> main, core branch.
>
> So I suggest something like:
>
> from("jbi:xxx")
>    .branch().log("Transforming message. Source: {in.message}",
> <loggingCategory>)
>    .to("jbi:service:http://mycompany.org/SaxonTransformMessage")
>    .branch().log("Message transformed. Result: {out.message}",
> <loggingCategory>);
>
> The branch() action actually creates a copy of the current message in the
> pipeline and spawns a new thread that executes the following actions.
>
> In my imagination, the log() method would create a new header in the message
> that contains the specified log message, and would immediately invoke a new
> LogProcessor that would take the message out from this header, substitute
> the tokens with the appropriate content, and finally call the Logger
> associated with the specified logging category.
>
> What do you think?
>
> From a user's point of view, I honestly believe the clearest keyword to use
> for this new pattern is "branch()".

I like it. Another suggestion to throw into the mix, I wonder what
folks think of "spawn" - thinking unix processes; spawning up a
separate process etc.

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com

Mime
View raw message