vocento / request-id
Installs: 36 856
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: >=5.6
- ramsey/uuid: ~3.5
Requires (Dev)
- phpunit/phpunit: ^5.5
This package is not auto-updated.
Last update: 2024-10-26 20:37:43 UTC
README
This library contains the class and the way a RequestId should be used between the microservices calls.
Installation
To install the library, include the package as a requirement in your composer.json
file.
composer require "vocento/request-id"
Usage
To create a new request id, import the class and the call the method create.
<?php ... use Vocento\RequestId; class Foo { ... public function method() { ... // Create a new request id $requestId = RequestId::create(); // Create a request id from var $requestId = RequestId::create($currentRequestId); // Create a request id from string $requestId = RequestId::create('my-own-request-id'); // Get the request id value $requestId->getId(); // Get the request id header name $headerName = RequestId::HEADER_NAME; $headerName = $requestId->getHeaderName(); ... } ... }