2017 © Pedro Peláez
 

bundle microservice-bundle

Base bundle for Microservice projects

image

vocento/microservice-bundle

Base bundle for Microservice projects

  • Wednesday, June 6, 2018
  • by aferrandini
  • Repository
  • 2 Watchers
  • 1 Stars
  • 5,351 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 19 Versions
  • 17 % Grown

The README.md

MicroserviceBundle

This bundle contains the base for the services at Vocento and how the versioning and other resources of the service should work., (*1)

Installation

To install the bundle, include the package as a requirement in your composer.json file., (*2)

composer require vocento/microservice-bundle

Once the bundle is installed, you have to configure it., (*3)

Configure the Bundle

Add the bundle to the config/bundles.php file., (*4)

<?php

return [
    // ...
    Vocento\MicroserviceBundle\MicroserviceBundle::class => ['all' => true],
];

Add the bundle configuration to config/packages/microservice.yaml file, (*5)

microservice:
    name: 'microservice-name'
    debug: '%kernel.debug%'
    manage_exceptions: true
    versions:
        list:
            - 'v1'
            - 'v2'
            - 'v3.1'
            - 'v3.1.4'
        current: 'v2'

Add the bundle routing configuration to config/routes/microservice.yaml file, (*6)

microservice:
    resource: "@MicroserviceBundle/Resources/config/routing/base.yml"

This configuration will expose three endpoints related with the service in order to enable a way to auto-discover the service, the available versions and the current version., (*7)

Service endpoints

Request GET /service, (*8)

{
    "name": "microservice-name",
    "current": "v2",
    "versions": [
        "v1",
        "v2",
        "v3.1",
        "v3.1.4"
    ]
}

Request GET /service/name.json, (*9)

{
    "name": "microservice-name"
}

Request GET /service/versions.json, (*10)

{
    "current": "v2",
    "versions": [
        "v1",
        "v2",
        "v3.1",
        "v3.1.4"
    ]
}

Request GET /service/versions/current.json, (*11)

{
    "version": "v2"
}

The Versions

06/06 2018
06/06 2018
21/03 2018

dev-hotfix/deprecated

dev-hotfix/deprecated

Base bundle for Microservice projects

  Sources   Download

proprietary

The Requires

 

The Development Requires

by Hector Prats

microservice bundle

21/10 2016
21/10 2016