Bundle provides services extending CXF features
CorrelationIdFeature- addscorrelationIdto all logs. Interceptors from this feature are executed in phasesRECEIVE(addingcorrelationId) andPRE_PROTOCOL(deleting).LoggingFeature- logs CXF requests and responses. Interceptors from this feature are executed in phasePRE_STREAM.
CorrelationIdFeatureshould be added only in locations, where WebService comes (<jaxws:endpoint />), it should not be added to client (<jaxws:client />).
- If incoming request has
X-CORRELATION-IDheader, insert it's value to MDC with keycorrelationId. - Else if MDC has entry with key
correlationIdleave this value, - Else generate
corrrelationIdand insert it to MDC wit keycorrelationId.
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/blueprint/jaxws"
xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://cxf.apache.org/blueprint/jaxws http://cxf.apache.org/schemas/blueprint/jaxws.xsd">
<jaxws:endpoint bus="servicebus" id="serviceEndpoint" implementor="#soap"
endpointName="s:webServiceSoap" serviceName="s:webService" address="${service.incoming.address}"
wsdlLocation="test.wsdl" xmlns:s="http://test.touk.pl">
<jaxws:features>
<bean class="pl.touk.cxf.interceptors.CorrelationIdFeature" />
<bean class="pl.touk.cxf.interceptors.logging.LoggingFeature" />
</jaxws:features>
</jaxws:endpoint>
</blueprint>