Hi, I've just upgraded to Camel 2.2 since I'd like to use the new NotifyBuilder in my test class. How ever it doesn't really seem to fit my use case 100%. What I'm missing is interception or "side-effect" support. In my test case I'd like to extract an ID that's located in the message body and store it away temporarily (for synchronization purposes). This means that I don't need any matching, I just want to perform some operation for each message that arrives to an endpoint. As a work-around I've created a Predicate that does exactly this which is defined by:
notifyBuilder.from(outboundEnpoint).filter(extractId()).create(); // extractId returns the Predicate impl I figure it would have been better to add e.g. a "filter(Interceptor interceptor)" method to NotifyBuilder which contains a method like "void intercept(Exchange exchange)". Also I've noticed that the "extractId" predicate instance is called twice for each message. I suppose that's because it gets called once for "ExchangeCreatedEvent" and once for the "ExchangeCompletedEvent". So I would also like tge ability to e.g. only filter "ExchangeCompletedEvent" events. In my case something like: notifyBuilder.from(outboundEnpoint).filter(extractIdInterceptor()).onExchangeCompletedEvent().create(); Or is there another way to achieve what I'm looking for? Thanks, /Johan -- View this message in context: http://old.nabble.com/NotifyBuilder-%22intercept%22-support-tp27608556p27608556.html Sent from the Camel - Users mailing list archive at Nabble.com.
