garlic / healthcheck
Health check Bundle used for graphQL schema introspection and whole schema merge at gateway
Installs: 565
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 8
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=7.1
- ext-json: *
- garlic/bus: ^1.0
- garlic/graphql: ^1.0
- predis/predis: ~1.1
- symfony/lock: ^4.2
This package is not auto-updated.
Last update: 2024-11-10 06:02:01 UTC
README
This bundle is a backend for serviceDiscoveryEvent, which is uasually a part of garlic/gateway bundle.
This bundle allows to form graphQL introspection schema as a self-describing method and send it back to gateway to process and merge it.
Target microservice subscribing on serviceDiscovery
event and forming serviceRebuildSchema
command with response data as
{ "name": "microservice_name", "data": "{...introspection_json_string}", "timing": "0.0021" }
Installation
Just a one thing are necessary for this bundle works.
Add garlic/bus bundle to your composer.json
composer require garlic/healthcheck
bundles.php
config/bundles.php - add bundle initialisation
Garlic\HealthCheck\HealthCheckBundle::class => ['all' => true],
redis config
Add to your .env file next configuration values
REDIS_HOST=localhost REDIS_PORT=6379 HEALTHCHECK_LOCK_TTL=30 - not nessessary, time in seconds until next run would be possible. Default is 30 sec
Usage
Service automatically begin to listen enqueue events with name serviceDiscovery
and generate proper COMMAND
for gaeway to rebuild actual whole schema introspection with new obtained data.
Data structure could be obtained at introspection.json
How to init event from outside
$container->get(CommunicatorService::class) ->serviceDiscoveryEvent(['date' => microtime(true)]);
How to send self-introspection manually
sf healthcheck:init
Response
Data structure to work with