This is a Symfony bridge for the framework agnostic Correlation ID library.
- Adds the Correlation ID to the Request and Response automatically.
- Header names can be configured for each separately.
- Provides a messenger stamp and middleware, that will add the CorrelationIDStamp to each message.
composer require phauthentic/correlation-id-symfony-bundle
You can configure three different settings to control the behavior:
response_header_name
- The name of the response header for the ID.request_header_name
- The name of the request header for the ID.pass_through
- If the ID from the request should be passed to the response enable this. This is useful if you are dealing with a microservice that is not exposed to the public but gets further actions delegated from the entry point and must retain the original ID.
config/correlation_id.yaml
:
correlation_id:
response_header_name: 'X-Correlation-ID'
request_header_name: 'X-Correlation-ID'
pass_through: false
The messenger middleware will add the Correlation ID to your messages. Just add the middleware to your bus.
Licensed under the MIT license.
Copyright (c) Phauthentic / Florian Krämer