On 9/25/07, Przemyslaw Budzik <[EMAIL PROTECTED]> wrote: > > > > gnodet wrote: > > > > But this kind of feature can not easily be generic. It would be > > specific for each kind of endpoints I suppose. Just to understand > > your use case a bit more, what do you want to do with messages that > > you don't want to process ? Just discard them ? Then you could use a > > filter (and use the route transformation layer i've just talked about > > maybe) or even use a camel filter which is really easy to set up. > > Also note that in the OSGi way, the whole classloader architecture is > > different and you can easily share libraries between JBI applications > > (you're not limited anymore to jars included in the SU). Even with > > 3.2, you can already add a SL to a SU classloader. > > > > > > Around intercepting is useful when eg. measuring because it wraps > invocation.
Agreed. > Listeners are not good for me because of their scope. Once set > per container collect all events from all assemblies. I want to aspectize > given SU/SA only. So it should be easier to do that in servicemix 4.0, as everything will be contained in a single jar. This is just a matter of defining the right filter (and easily). You could already do that, but there is no easy way to identify the SU/SA, so you'd end up with listing all the possible endpoints. Still, this is currently doable. > ExchangeListener has exchangeSent() > so it is like "after". Still a limitation. I know that there is an option to > use SL or copy jars to lib/optional, but it is still intrusive. Using > spring+aspectj AOP is powerful but what I need is only apply before/after > interceptor to given SU with less possible effort. I do believe there could > be sort of generic solution. The problem with exchange interception at the endpoint level is that you may want to intercept exchanges sent by this endpoint, which is not possible using AOP. However as the exchange listener will receive all sent and received message, it can easily filter what you need. For example you could define: <smx:interceptor ref="interceptor"> <smx:from endpointRef="fromEndpoint" /> <smx:to endpoint="name=toEndpoint" /> <smx:interceptor> We need to have better support for endpoint filtering, but once we have this, it should be quite easy to add your interceptors and easily control the exchanges you receive. And this would just use wrap the provided ExchangeListener with a wrapping implementation using the define filtering. Makes sense ? > -- > View this message in context: > http://www.nabble.com/Interceptors-like-functionality-tf4515215s12049.html#a12882271 > Sent from the ServiceMix - Dev mailing list archive at Nabble.com. > > -- Cheers, Guillaume Nodet ------------------------ Blog: http://gnodet.blogspot.com/
