Closed hohwille closed 8 years ago
UUID with JS: https://jsfiddle.net/briguy37/2MVFd/
In Angular create an interceptor as factory and register it in config
via:
$httpProvider.interceptors.push('myInterceptor');
The interceptor has to provide a function like this:
request: function (config) {
requestCounter++;
config.headers['X-Correlation-Id'] = uuid + requestCounter;
return config;
}
For oasp4j, this issues can be closed. PR merged.
In OASP4J there is a concept called correlationID that is used as MDC and is included into each log entry. The idea is to be able to follow and trace a call trough the entire application landscape of a SOA or MicroServices architecture.
Therefore the client has to include an HTTP Header
CorrelationId
that should be set as following:clientId
) is created (e.g. UUID)clientRequestCounter
) is initialized with 0CorrelationId
is set toclientId
-clientRequestCounter
.So if
clientId
is9fbe72def1924fa
the first request will have