akondas/symfony-consul-bundle

Auto register symfony app with Consul

0.2.0 2022-10-01 13:29 UTC

This package is auto-updated.

Last update: 2024-03-29 04:05:43 UTC


README

Register and deregister your Symfony application in Consul

Consul Service

1. Install

composer require akondas/symfony-consul-bundle

2. Configure

Enable this bundle in Symfony, add this line to your bundles.php file:

Akondas\ConsulBundle\ConsulBundle::class => ['all' => true]

Add routing:

consul_bundle:
  resource: '@ConsulBundle/Resources/config/routing.yml'

Configuration reference:

consul:
  service:
    name: 'subscription-service' # name of your app
    host: 'localhost' # host of your application under which it is available
    port: 8000 # port of your application under which it is available 
  client:
    base_uri: http://127.0.0.1:8500 # consule server uri

3. Use

Available commands:

  • bin/console consul:register - register application in Consul
  • bin/console consul:deregister - deregister application from Consul
  • bin/console debug:consul-check - debug Consul check