You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by Guillaume Nodet <gn...@gmail.com> on 2011/07/21 11:22:27 UTC

[DISCUSS] Global interceptors

For ServiceMix, we are in need for having *global* interceptors, i.e.
some kind of static list of interceptors and other strategies.   The
main use case is that users would deploy plain camel routes and
ServiceMix would kick in and configure its interceptors but without
any need for the user to change its route.

I'm not sure exactly all the SPI we'd need yet, but things like
InterceptStrategy, ProcessorFactory or EndpointStrategy may be needed.

So this email is just a heads up and to start any discussion ...

-- 
------------------------
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: [DISCUSS] Global interceptors

Posted by Guillaume Nodet <gn...@gmail.com>.
It's already the case and it does not fulfill my need for multiple reasons:
  * when the service is registered, it's way too late to change
anything, I need real low level interception
  * only contexts created by blueprint or spring are registered, not
those create with a java / scala / groovy DSL
  * i'd like to have a way that would work in a non OSGi environment,
for example in tomcat

On Thu, Jul 28, 2011 at 10:36, Christian Schneider
<ch...@die-schneider.net> wrote:
> How about offering the camelContext as an OSGi service? This way servicemix
> can use the whiteboard pattern to watch for camel contexts and register with
> them.
>
> Christian
>
>
> Am 28.07.2011 10:14, schrieb Guillaume Nodet:
>>
>> I found another way which I think is cleaner.  I've added a single
>> Container interface with a singleton which is called back whenever a
>> CamelContext is created.  The implementation can then add a
>> LifecycleListener or register any other SPI object.
>> See
>> https://github.com/gnodet/camel/commit/a13b4fc19b7fd9a1f6b7e945353d1246151267af
>>
>> Feedback welcome!
>>
>> On Thu, Jul 21, 2011 at 11:22, Guillaume Nodet<gn...@gmail.com>  wrote:
>>>
>>> For ServiceMix, we are in need for having *global* interceptors, i.e.
>>> some kind of static list of interceptors and other strategies.   The
>>> main use case is that users would deploy plain camel routes and
>>> ServiceMix would kick in and configure its interceptors but without
>>> any need for the user to change its route.
>>>
>>> I'm not sure exactly all the SPI we'd need yet, but things like
>>> InterceptStrategy, ProcessorFactory or EndpointStrategy may be needed.
>>>
>>> So this email is just a heads up and to start any discussion ...
>>>
>>> --
>>> ------------------------
>>> Guillaume Nodet
>>> ------------------------
>>> Blog: http://gnodet.blogspot.com/
>>> ------------------------
>>> Open Source SOA
>>> http://fusesource.com
>>>
>>
>>
>
>
> --
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> Talend Application Integration Division http://www.talend.com
>
>



-- 
------------------------
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: [DISCUSS] Global interceptors

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Christian,

It's already the case. CamelContext are exposed as OSGi services. It's 
used in Camel commands to list it, etc.
The whiteboard could work but it depends what we want to achieve.

Regards
JB

On 07/28/2011 10:36 AM, Christian Schneider wrote:
> How about offering the camelContext as an OSGi service? This way
> servicemix can use the whiteboard pattern to watch for camel contexts
> and register with them.
>
> Christian
>
>
> Am 28.07.2011 10:14, schrieb Guillaume Nodet:
>> I found another way which I think is cleaner. I've added a single
>> Container interface with a singleton which is called back whenever a
>> CamelContext is created. The implementation can then add a
>> LifecycleListener or register any other SPI object.
>> See
>> https://github.com/gnodet/camel/commit/a13b4fc19b7fd9a1f6b7e945353d1246151267af
>>
>>
>> Feedback welcome!
>>
>> On Thu, Jul 21, 2011 at 11:22, Guillaume Nodet<gn...@gmail.com> wrote:
>>> For ServiceMix, we are in need for having *global* interceptors, i.e.
>>> some kind of static list of interceptors and other strategies. The
>>> main use case is that users would deploy plain camel routes and
>>> ServiceMix would kick in and configure its interceptors but without
>>> any need for the user to change its route.
>>>
>>> I'm not sure exactly all the SPI we'd need yet, but things like
>>> InterceptStrategy, ProcessorFactory or EndpointStrategy may be needed.
>>>
>>> So this email is just a heads up and to start any discussion ...
>>>
>>> --
>>> ------------------------
>>> Guillaume Nodet
>>> ------------------------
>>> Blog: http://gnodet.blogspot.com/
>>> ------------------------
>>> Open Source SOA
>>> http://fusesource.com
>>>
>>
>>
>
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: [DISCUSS] Global interceptors

Posted by Christian Schneider <ch...@die-schneider.net>.
How about offering the camelContext as an OSGi service? This way 
servicemix can use the whiteboard pattern to watch for camel contexts 
and register with them.

Christian


Am 28.07.2011 10:14, schrieb Guillaume Nodet:
> I found another way which I think is cleaner.  I've added a single
> Container interface with a singleton which is called back whenever a
> CamelContext is created.  The implementation can then add a
> LifecycleListener or register any other SPI object.
> See https://github.com/gnodet/camel/commit/a13b4fc19b7fd9a1f6b7e945353d1246151267af
>
> Feedback welcome!
>
> On Thu, Jul 21, 2011 at 11:22, Guillaume Nodet<gn...@gmail.com>  wrote:
>> For ServiceMix, we are in need for having *global* interceptors, i.e.
>> some kind of static list of interceptors and other strategies.   The
>> main use case is that users would deploy plain camel routes and
>> ServiceMix would kick in and configure its interceptors but without
>> any need for the user to change its route.
>>
>> I'm not sure exactly all the SPI we'd need yet, but things like
>> InterceptStrategy, ProcessorFactory or EndpointStrategy may be needed.
>>
>> So this email is just a heads up and to start any discussion ...
>>
>> --
>> ------------------------
>> Guillaume Nodet
>> ------------------------
>> Blog: http://gnodet.blogspot.com/
>> ------------------------
>> Open Source SOA
>> http://fusesource.com
>>
>
>


-- 
--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com


Re: [DISCUSS] Global interceptors

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Guillaume,

indeed, it looks cleaner. Let me take a deeper look on the code but it 
sounds good.

Regards
JB

On 07/28/2011 10:14 AM, Guillaume Nodet wrote:
> I found another way which I think is cleaner.  I've added a single
> Container interface with a singleton which is called back whenever a
> CamelContext is created.  The implementation can then add a
> LifecycleListener or register any other SPI object.
> See https://github.com/gnodet/camel/commit/a13b4fc19b7fd9a1f6b7e945353d1246151267af
>
> Feedback welcome!
>
> On Thu, Jul 21, 2011 at 11:22, Guillaume Nodet<gn...@gmail.com>  wrote:
>> For ServiceMix, we are in need for having *global* interceptors, i.e.
>> some kind of static list of interceptors and other strategies.   The
>> main use case is that users would deploy plain camel routes and
>> ServiceMix would kick in and configure its interceptors but without
>> any need for the user to change its route.
>>
>> I'm not sure exactly all the SPI we'd need yet, but things like
>> InterceptStrategy, ProcessorFactory or EndpointStrategy may be needed.
>>
>> So this email is just a heads up and to start any discussion ...
>>
>> --
>> ------------------------
>> Guillaume Nodet
>> ------------------------
>> Blog: http://gnodet.blogspot.com/
>> ------------------------
>> Open Source SOA
>> http://fusesource.com
>>
>
>
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: [DISCUSS] Global interceptors

Posted by Guillaume Nodet <gn...@gmail.com>.
I found another way which I think is cleaner.  I've added a single
Container interface with a singleton which is called back whenever a
CamelContext is created.  The implementation can then add a
LifecycleListener or register any other SPI object.
See https://github.com/gnodet/camel/commit/a13b4fc19b7fd9a1f6b7e945353d1246151267af

Feedback welcome!

On Thu, Jul 21, 2011 at 11:22, Guillaume Nodet <gn...@gmail.com> wrote:
> For ServiceMix, we are in need for having *global* interceptors, i.e.
> some kind of static list of interceptors and other strategies.   The
> main use case is that users would deploy plain camel routes and
> ServiceMix would kick in and configure its interceptors but without
> any need for the user to change its route.
>
> I'm not sure exactly all the SPI we'd need yet, but things like
> InterceptStrategy, ProcessorFactory or EndpointStrategy may be needed.
>
> So this email is just a heads up and to start any discussion ...
>
> --
> ------------------------
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
>



-- 
------------------------
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: [DISCUSS] Global interceptors

Posted by Zbarcea Hadrian <hz...@gmail.com>.
The interceptors story in camel needs revisiting anyway.

Hadrian


On Jul 21, 2011, at 5:22 AM, Guillaume Nodet wrote:

> For ServiceMix, we are in need for having *global* interceptors, i.e.
> some kind of static list of interceptors and other strategies.   The
> main use case is that users would deploy plain camel routes and
> ServiceMix would kick in and configure its interceptors but without
> any need for the user to change its route.
> 
> I'm not sure exactly all the SPI we'd need yet, but things like
> InterceptStrategy, ProcessorFactory or EndpointStrategy may be needed.
> 
> So this email is just a heads up and to start any discussion ...
> 
> -- 
> ------------------------
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com


Re: [DISCUSS] Global interceptors

Posted by Matt Pavlovich <ma...@gmail.com>.
+1 

Totally agree.  This is a functionality that I've implemented a number of times and is great for creating audit trails, and replay. 

On Jul 21, 2011, at 4:22 AM, Guillaume Nodet wrote:

> For ServiceMix, we are in need for having *global* interceptors, i.e.
> some kind of static list of interceptors and other strategies.   The
> main use case is that users would deploy plain camel routes and
> ServiceMix would kick in and configure its interceptors but without
> any need for the user to change its route.
> 
> I'm not sure exactly all the SPI we'd need yet, but things like
> InterceptStrategy, ProcessorFactory or EndpointStrategy may be needed.
> 
> So this email is just a heads up and to start any discussion ...
> 
> -- 
> ------------------------
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com


Re: [DISCUSS] Global interceptors

Posted by Johan Edstrom <se...@gmail.com>.
+1


On Jul 24, 2011, at 12:01, Christian Müller <ch...@gmail.com> wrote:

> +1
> 
> One of the features we are missing in SMX 4.x...
> 
> Best,
> Christian
> 
> On Fri, Jul 22, 2011 at 7:07 AM, Jean-Baptiste Onofré <jb...@nanthrax.net>wrote:
> 
>> +1
>> 
>> It's a must have for "new" SMX :)
>> 
>> Regards
>> JB
>> 
>> 
>> On 07/21/2011 11:22 AM, Guillaume Nodet wrote:
>> 
>>> For ServiceMix, we are in need for having *global* interceptors, i.e.
>>> some kind of static list of interceptors and other strategies.   The
>>> main use case is that users would deploy plain camel routes and
>>> ServiceMix would kick in and configure its interceptors but without
>>> any need for the user to change its route.
>>> 
>>> I'm not sure exactly all the SPI we'd need yet, but things like
>>> InterceptStrategy, ProcessorFactory or EndpointStrategy may be needed.
>>> 
>>> So this email is just a heads up and to start any discussion ...
>>> 
>>> 
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>> 

Re: [DISCUSS] Global interceptors

Posted by Christian Müller <ch...@gmail.com>.
+1

One of the features we are missing in SMX 4.x...

Best,
Christian

On Fri, Jul 22, 2011 at 7:07 AM, Jean-Baptiste Onofré <jb...@nanthrax.net>wrote:

> +1
>
> It's a must have for "new" SMX :)
>
> Regards
> JB
>
>
> On 07/21/2011 11:22 AM, Guillaume Nodet wrote:
>
>> For ServiceMix, we are in need for having *global* interceptors, i.e.
>> some kind of static list of interceptors and other strategies.   The
>> main use case is that users would deploy plain camel routes and
>> ServiceMix would kick in and configure its interceptors but without
>> any need for the user to change its route.
>>
>> I'm not sure exactly all the SPI we'd need yet, but things like
>> InterceptStrategy, ProcessorFactory or EndpointStrategy may be needed.
>>
>> So this email is just a heads up and to start any discussion ...
>>
>>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>

Re: [DISCUSS] Global interceptors

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
+1

It's a must have for "new" SMX :)

Regards
JB

On 07/21/2011 11:22 AM, Guillaume Nodet wrote:
> For ServiceMix, we are in need for having *global* interceptors, i.e.
> some kind of static list of interceptors and other strategies.   The
> main use case is that users would deploy plain camel routes and
> ServiceMix would kick in and configure its interceptors but without
> any need for the user to change its route.
>
> I'm not sure exactly all the SPI we'd need yet, but things like
> InterceptStrategy, ProcessorFactory or EndpointStrategy may be needed.
>
> So this email is just a heads up and to start any discussion ...
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com