camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen" ...@silverbullet.dk>
Subject RE: Explanation requested for when intercept defined outside of the route ?
Date Thu, 10 Jul 2008 10:27:49 GMT
Hi

We have a JIRA ticket for a separate page for the interceptor. Currently there is only a little
sniff at the DSL page
https://issues.apache.org/activemq/browse/CAMEL-442
http://activemq.apache.org/camel/dsl.html

Ad 1)
Yes one of the things I would like to improve is to make it easier for end users to add their
own with this method. However you can use the existing DSL to route to a bean and there you
can do what you want with the exchange.

This method is for adding interceptors that is more tightly coupled with Camel where you can
do more advanced stuff, hence some of the tracer and JMX stuff is added like this.

Ad 2 + 3)
If you add intercept() outside a route it's a global intercepter for all the rouutes. 

On the other hand if you add it within a route it's only for this route.





Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: cmoulliard [mailto:cmoulliard@gmail.com] 
Sent: 10. juli 2008 12:16
To: camel-user@activemq.apache.org
Subject: Explanation requested for when intercept defined outside of the route ?


Hi,

I see in the tests case of Camel that they are at least three different ways
to use the interceptor :

1) Add tracer as an interceptor (using the context)

getcontext().addInterceptorStrategy(InterceptStrategy);

where InterceptStrategy can be :
- Debugger : to debug and trace
- Tracer : to trace routes
- Instrumentation : for monitoring performance metrics

Remark : It should be interesting to have test case to see How to implement
InstrumentationInterceptStrategy ?

2) intercept is embedded in the routing

e.g.  from("seda:bar").intercept().to("log:hoho")

3) intercept is defined outside of the route

e.g.

intercept(header("foo").isEqualTo("bar")).to("mock:b").proceed();

from(direct:start").to("mock:a");

Questions :

- What is the difference between case 2) and 3) if there is one ?
- What will be intercepted in the case 3)  ?

Regards,

Charles

-- 
View this message in context: http://www.nabble.com/Explanation-requested-for-when-intercept-defined-outside-of-the-route---tp18379790s22882p18379790.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message