For inbound request handling we want to be able to keep track of each request in the logs via a Correlation ID, this means that we would need to do the following:
When a Correlation-Id has not been provided in the headers, we create a new one (UUID) and set the context - add it to the response
If a Correlation-Id exists, then set it as the current logging context for the request - add it to response
Acceptance Criteria:
Given that the Spring App is running
When I call the /message endpoint without a Correlation-Id header
Then one is created and returned in the response headers
Given that the Spring App is running
When I call the /message endpoint with a Correlation-Id header
Then it is returned in the response headers
Given that the Spring App is running
When I call the /message endpoint with a Correlation-Id header
Then the correlation-id is added as a field in the JSON log output
For inbound request handling we want to be able to keep track of each request in the logs via a Correlation ID, this means that we would need to do the following:
Acceptance Criteria:
Given that the Spring App is running When I call the /message endpoint without a Correlation-Id header Then one is created and returned in the response headers
Given that the Spring App is running When I call the /message endpoint with a Correlation-Id header Then it is returned in the response headers
Given that the Spring App is running When I call the /message endpoint with a Correlation-Id header Then the correlation-id is added as a field in the JSON log output