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"
}
Just a one thing are necessary for this bundle works.
composer require garlic/healthcheck
config/bundles.php - add bundle initialisation
Garlic\HealthCheck\HealthCheckBundle::class => ['all' => true],
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
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
$container->get(CommunicatorService::class)
->serviceDiscoveryEvent(['date' => microtime(true)]);
sf healthcheck:init
Data structure to work with