Hi Sorry, was about to send this reply earlier on but Dan has just replied with the answer...
The reason is that those interceptors are assuming they are server-side, so PersistOutInterceptor would always get an inMessage. They need to be refactored a bit so that they can work on the client and the server... By the way, I think the reason they did not end up in CXF 2.2.x as well was that as a time when they were contributed, the idea was that a UI viewer would also be add to a rt-management-web component but the author (Rémi Flament) did not get a chance to implement it. Now that Tomasz is working on a browser for viewing the logs, I'm just thinking that may be this browser may be extended in time to support viewing the exchange details (and may be JMX statistcis) too in another tab cheers, Sergey On Tue, Jul 20, 2010 at 2:15 PM, Mishkin, Ernest < [email protected]> wrote: > Hello, > > I must be missing something fundumental about in/out interceptor chains, > because here's what's happening: > > - this is about the client (making a call) code > > - I register interceptors like this: > > client.getInInterceptors().add(new LoggingInInterceptor()); > client.getOutInterceptors().add(new LoggingOutInterceptor()); > PersistOutInterceptor persistOut = new PersistOutInterceptor(); > persistOut.setExchangeDataDAO(<custom ExchangeDataDAO impl>); > client.getOutInterceptors().add(persistOut); > client.getInInterceptors().add(new PersistInInterceptor()); > > - when I make the call, I see that > PersistOutInterceptor::handleMessage() is invoked first - which makes > sense, I'm making an outgoing call, so first a message needs to go out. > > However, the first line of code in that method is > > ExchangeData exchangeData = > message.getExchange().getInMessage().getContent(ExchangeData.class); > > This throws NPE b/c getInMessage() returns null. And it sort of makes > sense that it's null - there's no "in" message (aka response) yet - > we're still trying to make the call. > > So why does PersistOutInterceptor look for the *in* message? What am I > missing in this very simple setup? > > > Thanks! > --Ernest > > > -----Original Message----- > From: Sergey Beryozkin [mailto:[email protected]] > Sent: Thursday, July 15, 2010 5:13 PM > To: [email protected] > Subject: Re: Persisting outgoing reqs interceptor > > Hi > > PersistIn/OutInterceptors were contributed too, > http://svn.apache.org/repos/asf/cxf/trunk/rt/management/src/main/java/or > g/apache/cxf/management/interceptor/<http://svn.apache.org/repos/asf/cxf/trunk/rt/management/src/main/java/or%0Ag/apache/cxf/management/interceptor/> > > for example, > > http://svn.apache.org/repos/asf/cxf/trunk/rt/management/src/main/java/or > g/apache/cxf/management/persistence/FilesystemExchangeDataDAO.java<http://svn.apache.org/repos/asf/cxf/trunk/rt/management/src/main/java/or%0Ag/apache/cxf/management/persistence/FilesystemExchangeDataDAO.java> > > can be used to persist data to the file, similarly the data can be saved > to the db storage, etc > > not sure if it is exactly what is needed... > > cheers, Sergey > > -------------------------------------------------------- > > The information contained in this message is intended only for the > recipient, and may be a confidential attorney-client communication or may > otherwise be privileged and confidential and protected from disclosure. If > the reader of this message is not the intended recipient, or an employee or > agent responsible for delivering this message to the intended recipient, > please be aware that any dissemination or copying of this communication is > strictly prohibited. If you have received this communication in error, > please immediately notify us by replying to the message and deleting it from > your computer. The McGraw-Hill Companies, Inc. reserves the right, subject > to applicable local law, to monitor and review the content of any electronic > message or information sent to or from McGraw-Hill employee e-mail addresses > without informing the sender or recipient of the message. > -------------------------------------------------------- >
