Edit: Mule 3.3.1
I want to log the amount of time my flow spends waiting on an external service, plus some additional information about the call. Right now, I'm doing that with a custom component that I declare globally:
<spring:beans>
<spring:bean id="idAuth" class="com.ca.eai.esb.component.OutboundLogger">
<spring:property name="calloutName" value="Authorization"/>
</spring:bean>
</spring:beans>
and then invoke before and after my callout:
<component>
<spring-object bean="idAuth"/>
</component>
<https:outbound-endpoint..../>
<component>
<spring-object bean="idAuth"/>
</component>
It keeps track of time plus records some other facts.
My question is if there is a better way? I'm thinking about how you can log before & after information about a flow by implementing an AbstractEnvelopeInterceptor and declaring it at the beginning of the flow. Is there something analogous that you can implement and bind to the endpoint and have a method invoked on request and then another method invoked on response?