phauthentic / correlation-id-symfony-bundle
1.2.0
2024-04-01 22:14 UTC
Requires
- phauthentic/correlation-id: ^2.0
- symfony/http-kernel: ^6.0||^7.0
Requires (Dev)
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^10.5.15
- squizlabs/php_codesniffer: ^3.9
- symfony/config: ^6.0||^7.0
- symfony/dependency-injection: ^6.0||^7.0
- symfony/messenger: ^6.0||^7.0
- symfony/phpunit-bridge: ^6.0||^7.0
This package is auto-updated.
Last update: 2024-12-01 00:15:47 UTC
README
This is a Symfony bridge for the framework agnostic Correlation ID library.
Features
- 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.
Installation
composer require phauthentic/correlation-id-symfony-bundle
Configuration
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
Messenger Middleware
The messenger middleware will add the Correlation ID to your messages. Just add the middleware to your bus.
Copyright & License
Licensed under the MIT license.
Copyright (c) Phauthentic / Florian Krämer