camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roman Kalukiewicz" <roman.kalukiew...@gmail.com>
Subject Re: [SPAM] Re: Custom log messages
Date Tue, 16 Sep 2008 17:33:23 GMT
What about still using to() but WITH some other body, like

with(el("This is my body: ${body}")).to("log:my.log")

so it works in a similar way as multicast modifies the behaviour of
to() (example: multicast().to(a, b, c))

or in opposite way

to(log:my.log).with(el(...))

What do you think? I just believe that then it is clear that we simply
sending the message.

My $0.02

Roman

2008/9/16 Claus Ibsen <ci@silverbullet.dk>:
> Hi
>
> +1 to Spawn. And I guess fork is also a word in the category.
>
> However the pattern smells like the wiretap pattern. What's the difference here? The
camel example is just a pipeline where the message is sent to the wire tap before it's processed
by the real route. I got the impression from the EIP book that this was in 2 threads. That
the wire tap is running in its own thread, and the original route runs in the original thread.
>
> http://activemq.apache.org/camel/wire-tap.html
> http://www.enterpriseintegrationpatterns.com/WireTap.html
>
>
>
> Med venlig hilsen
>
> Claus Ibsen
> ......................................
> Silverbullet
> Skovsgårdsvænget 21
> 8362 Hørning
> Tlf. +45 2962 7576
> Web: www.silverbullet.dk
> -----Original Message-----
> From: James Strachan [mailto:james.strachan@gmail.com]
> Sent: 16. september 2008 18:14
> To: camel-user@activemq.apache.org
> Subject: [SPAM] Re: Custom log messages
>
> 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