elastic/transport
PSR-7/17/18 HTTP transport library for Elastic PHP clients. Uses HTTPlug discovery for clients/factories and supports async via compatible PSR-18 clients (e.g., Guzzle, Symfony). Falls back to a built-in cURL client if none found.
Fixed a missing dependency of nyholm/psr7, moved from require-dev to require.
This is a new major release that includes the following change:
elastic-transport-php does not detect any installed PSR-18 clients. This client relies on the cURL php extension that must be installed. Moreover, this client does not implement the HttpAsyncClient interface, which means you won't be able to send asynchronous requests.If you need support for asynchronous requests, consider installing a PST-18 HTTP client like Guzzle:
composer require guzzlehttp/guzzle
composer require symfony/http-client
We introduced this change to remove the guzzle dependency in elasticsearch-php, as discussed here.
Other than that, no BC breaks have been introduced in the 9.0.0 release.
This release introduces the following changes and fixes:
Node::getLastPing and Node::getFailedPings for custom NodePool implementations with ping backoffs #35NoNodeAvailableException for debugging #34getLastRequest() and getLastResponse() #33We introduced in #27 and 2be33cd the support of OpenTelemetry for the HTTP send request. At the moment, the support is only for synchronous HTTP call.
To enable the OpenTelemetry you need to set the ENV variable OTEL_PHP_INSTRUMENTATION_ELASTICSEARCH_ENABLED to true.
We added the support natively in the Transport:sendRequest() function. By default, the Transport create a span from a Tracer provider (e.g. Global) with the following attributes:
http.request.method
url.full
server.address
server.port
If the $request sent using Transport::sendRequest($request) is a PSR-7 ServerRequest we get the attribute with name otel-elastic-transport and we pass to the OTel span as additional attributes. In this way, libraries like elasticsearch-php can inject specific OTel attributes (e.g. db.operation.name).
We created an OpenTelemetry class to provide all the configuration.
This release contains the following new feature:
This release contains the following new feature:
This release contains the following fix:
Release created to be compatible with 8.3 Elastic PHP clients.
Release created to be compatible with 8.2 Elastic PHP clients.
Release created to be compatible with 7.17 Elastic PHP clients.
Release created to be compatible with 8.1 Elastic PHP clients.
Support of psr/log v1, 2 and 3 to fix the dependency with elasticsearch/elasticsearch a413687
Finally, the 8.0.0 release.
TransportException to extends the Throwableinterface 57f0265This RC3 release introduces the OnSuccessInterface and OnFailureInterface for managing the async code with the execution of a custom function during the return of OnSuccess and during the execution of OnFailure. As default behaviour the OnSuccessDefault and OnFailureDefault does not perform any operations.
This RC2 release uses httplug v2.3.0 to provide a full retry async mechanism, thanks to PR https://github.com/php-http/httplug/pull/168.
This the first release candidate for 8.0.0 it contains some new features and changes with the previous 7.x Elastic PHP client.
ConnectionPool namespace has been renamed in NodePool, consequently all the Connection classes has been renamed in NodeHttpAsyncClient interface using Promise.Trasnport::sendAsyncRequest(RequestInterface $request): Promise to send a PSR-7 request using asynchronous requestTransport::setAsyncClient(HttpAsyncClient $asyncClient) and Transport::getAsyncClient() functions. If the PSR-18 client already implements the HttpAsyncClient interface you don't need to use the setAsyncClient() function, it will discovered automaticallyTransport::setRetries() function to specify the number of HTTP request retries to apply. If the HTTP failures exceed the number of retries the client generates a NoNodeAvailableExceptionRelease created to be compatible with 7.16 Elastic PHP clients.
Release created to be compatible with 7.15 Elastic PHP clients.
Release created to be compatible with 7.14 Elastic PHP clients.
This is the first stable release! :tada: Release created to be compatible with 7.13 Elastic clients.
This is the first beta release for version 7.12.0.
How can I help you explore Laravel packages today?