Hi, One additional question: Could I deploy these listeners on the fly?
BR, - Jussi - On Mon, Sep 22, 2008 at 3:05 PM, Jussi Nummelin <[EMAIL PROTECTED]> wrote: > Thanks Guillaume. > > I will take a look at the examples you provided and try to build a > sample around those to verify that this is what we're after. > > BR, > - Jussi - > > > On Mon, Sep 22, 2008 at 11:58 AM, Guillaume Nodet <[EMAIL PROTECTED]> wrote: >> Ok, I misunderstood because there is an interface which is called >> ExchangeListener which has a completely different purpose. >> Actually, it may be of some interest for you. >> This interface is called >> org.apache.servicemix.jbi.event.ExchangeListener and can be used to >> intercept exchanges synchronously. >> If you register such a listener on the JBI container, it will be given >> all the exchanges sent or received synchronously. >> For some examples on how to use those, you can check the following code: >> >> http://svn.apache.org/repos/asf/servicemix/smx3/trunk/core/servicemix-audit/src/main/java/org/apache/servicemix/jbi/audit/AbstractAuditor.java >> >> http://svn.apache.org/repos/asf/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/view/DotViewFlowListener.java >> >> You can register those using >> <smx:container ...> >> <smx:listeners> >> .. put your listener here ... >> </smx:listeners> >> </smx:container> >> >> Alternatively, you can extend the BaseSystemService to participate in >> the container lifecycle and register it using >> <smx:container ...> >> <smx:services> >> .. put your listener here ... >> </smx:services> >> </smx:container> >> >> If you simply need a reference to the JBI container, your listener can >> implement the ContainerAware interface. >> >> On Mon, Sep 22, 2008 at 10:43 AM, Jussi Nummelin >> <[EMAIL PROTECTED]> wrote: >>> Hi, >>> >>> http://servicemix.apache.org/maven/servicemix-core/apidocs/org/apache/servicemix/MessageExchangeListener.html >>> >>> "If a Component implements this interface, MessageExchange will be >>> delivered directly to the listener asynchronously rather than using >>> the usual asynchronous delivery with a thread used up per consuming >>> component." >>> >>> Basically what I'm looking for is kind of a synchronous Wiretap >>> pattern without modifying the sender or EIP pattern in use. What I >>> want to achieve is an intercepting model to plug in different aspects >>> in AOP style. >>> >>> BR, >>> - Jussi - >>> >>> On Mon, Sep 22, 2008 at 10:43 AM, Guillaume Nodet <[EMAIL PROTECTED]> wrote: >>>> No, the listeners are invoked synchronously. >>>> Where did you found this misleading documentation, it should be fixed ? >>>> >>>> On Mon, Sep 22, 2008 at 9:26 AM, Jussi Nummelin >>>> <[EMAIL PROTECTED]> wrote: >>>>> Hi, >>>>> >>>>> Looking at the documentation it seems that the ExchangeListener works >>>>> in async mode (respect to the original message exchange), is that >>>>> correct? >>>>> >>>>> Is there any way to configure it to work in synchronous way, i.e. the >>>>> MEX would be delivered only after the listener is finished processing? >>>>> >>>>> >>>>> BR, >>>>> - Jussi - >>>>> >>>> >>>> >>>> >>>> -- >>>> Cheers, >>>> Guillaume Nodet >>>> ------------------------ >>>> Blog: http://gnodet.blogspot.com/ >>>> ------------------------ >>>> Open Source SOA >>>> http://open.iona.com >>>> >>> >> >> >> >> -- >> Cheers, >> Guillaume Nodet >> ------------------------ >> Blog: http://gnodet.blogspot.com/ >> ------------------------ >> Open Source SOA >> http://open.iona.com >> >
