What I need to time is the request entry time and how long it takes to process 
the business logic in the middleware. I got some nasty backend calls which can 
be pretty time-consuming. So what I need to know is when does the processing of 
the response continue.

Isn't the else statment displaying this when I configure the interceptor for 
both in and outbound calls?

Anyway will look into the CounterRepository.

Cheers,
Pete


-------- Original-Nachricht --------
> Datum: Fri, 17 Sep 2010 14:38:20 -0400
> Von: Daniel Kulp <[email protected]>
> An: [email protected]
> CC: [email protected]
> Betreff: Re: Single Interceptor for In/Outbound Message

> On Thursday 16 September 2010 2:26:58 am [email protected] wrote:
> > OK. Got it. So I will not further follow this approach.
> > 
> > Maybe this solution is more straightforward. I'm just wondering if it
> will 
> > work in a multiuser scenario?
> 
> It would work on the CLIENT side, yes (although USER_LOGICAL is probably 
> better).   On the server side, it would only log the time around the
> invoke of 
> the service, not all the stuff CXF would do such as reading/writing,
> handling 
> ws-security, etc...   Guess it depends on what you want to time.  :-)
> 
> That said, have you looked at the ResponseTimeFeature we already have in
> CXF?
> 
> http://svn.apache.org/viewvc/cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/interceptor/
> 
> (which, apparently isn't documented)
> 
> However, there is some very minimal docs at the bottom of:
> http://cxf.apache.org/docs/jmx-management.html
> about the counter repository stuff.
> 
> 
> Dan
> 
> 
> 
> > 
> > super(Phase.POST_LOGICAL);
> >     addAfter(ReadHeadersInterceptor.class.getName());
> > }
> > 
> > public void handleMessage(SoapMessage message) throws Fault {
> >     Exchange ex = message.getExchange();
> > 
> >     if (message.getVersion() instanceof Soap11) {
> > 
> >     Map<String, List<String>> headers = CastUtils.cast((Map)
> >         message.get(Message.PROTOCOL_HEADERS));
> >     if (headers != null) {
> >     List<String> sa = headers.get("SOAPAction");
> >     if (sa != null && sa.size() > 0) {
> >     String action = sa.get(0);
> >            if (action.startsWith("\"")) {
> >       action = action.substring(1, action.length() - 1);
> >        }
> > 
> >     System.out.println("[STATISTICS] [action] " + action);
> >     ex.put("startTime", System.currentTimeMillis());
> >                     }
> >     }
> >         else {
> >     long diff = System.currentTimeMillis()
> >                     -Long.valueOf(ex.get("startTime").toString());
> >     long diffMs = diff % 1000;
> >         System.out.println("[STATISTICS] [duration]"+ diffMs + " ms");
> > 
> >             }
> >     }
> > }
> 
> -- 
> Daniel Kulp
> [email protected]
> http://dankulp.com/blog

-- 
Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!  
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail

Reply via email to