Download the PHP package oat-sa/lib-correlation-ids-guzzle without Composer
On this page you can find all versions of the php package oat-sa/lib-correlation-ids-guzzle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download oat-sa/lib-correlation-ids-guzzle
More information about oat-sa/lib-correlation-ids-guzzle
Files in oat-sa/lib-correlation-ids-guzzle
Package lib-correlation-ids-guzzle
Short Description OAT Correlation Ids Guzzle Library
License GPL-2.0-only
Informations about the package lib-correlation-ids-guzzle
Correlation Ids Guzzle Middleware Library
PHP library for correlation ids guzzle middleware based on the correlation ids library.
Table of contents
- Installation
- Principles
- Usage
- Tests
Installation
Principles
This library provides a ready to use guzzle middleware that forwards, as request headers, the correlation ids fetched from the correlation ids registry.
Notes
- the current process correlation id will be forwarded as the parent one,
- the root correlation id will be also forwarded.
More details about calls chaining available on the correlation ids library documentation.
Usage
With the provided factory
The GuzzleClientFactory
creates for you a guzzle client with the middleware already enabled:
Manually
You need to push the CorrelationIdsGuzzleMiddleware
to your handler stack as follow:
Note: you can customize the log context key names by providing you own CorrelationIdsHeaderNamesProviderInterface implementation and pass it to the CorrelationIdsGuzzleMiddleware
constructor.
Tests
To run tests:
Note: see phpunit.xml.dist for available test suites.
All versions of lib-correlation-ids-guzzle with dependencies
oat-sa/lib-correlation-ids Version ^0.2.0
guzzlehttp/guzzle Version ^6.4|^7.0