phauthentic / correlation-id-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-08-31 00:38:53 UTC
README
这是一个用于框架无关的 Correlation ID 库 的 Symfony 桥接器。
功能
- 自动将 Correlation ID 添加到请求和响应中。
- 可以为每个配置不同的头部名称。
- 提供消息传递标记和中间件,将 CorrelationIDStamp 添加到每个消息中。
安装
composer require phauthentic/correlation-id-symfony-bundle
配置
您可以配置三个不同的设置来控制行为
response_header_name
- ID 的响应头部名称。request_header_name
- ID 的请求头部名称。pass_through
- 如果需要将请求中的 ID 传递到响应中,请启用此选项。这对于处理不公开但由入口点委托进一步操作的微服务很有用,必须保留原始 ID。
config/correlation_id.yaml
:
correlation_id: response_header_name: 'X-Correlation-ID' request_header_name: 'X-Correlation-ID' pass_through: false
Messenger 中间件
消息传递中间件会将 Correlation ID 添加到您的消息中。只需将中间件添加到您的总线即可。
版权 & 许可证
根据 MIT 许可证 许可。
版权 (c) Phauthentic / Florian Krämer