PHPackages                             lushdigital/microservice-aggregator-transport - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. lushdigital/microservice-aggregator-transport

ActiveLibrary[Framework](/categories/framework)

lushdigital/microservice-aggregator-transport
=============================================

A set of convenience classes and interfaces for simplifying aggregation of data from multiple microservices.

1.1.1(8y ago)06651MITPHP

Since Aug 15Pushed 8y ago2 watchersCompare

[ Source](https://github.com/LUSHDigital/microservice-aggregator-transport)[ Packagist](https://packagist.org/packages/lushdigital/microservice-aggregator-transport)[ RSS](/packages/lushdigital-microservice-aggregator-transport/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (3)Versions (15)Used By (0)

Lush Digital - Micro Service Aggregator Transport
=================================================

[](#lush-digital---micro-service-aggregator-transport)

A set of convenience classes and interfaces for simplifying aggregation of data from multiple microservices.

The purpose of the package is to provide a reliable, testable and easy to use means of communicating with microservices within a service oriented architecture.

Package Contents
----------------

[](#package-contents)

- Service interface
- Service abstract class
- Cloud service interface
- Cloud service abstract class
- Request class

Installation
------------

[](#installation)

Install the package as normal:

```
$ composer require lushdigital/microservice-aggregator-transport
```

Copy the `src/config/transport.php` file into your `config` folder in the root of your app.

Finally add the following line to your `bootstrap/app.php` file:

```
$app->configure('transport');
```

Creating a Service
------------------

[](#creating-a-service)

The first thing you need to do to utilise this package is to create a class to interact with your service.

This class will extend one of the base classes this package provides; you add your own methods for each endpoint of the service you want to access.

### Local Service

[](#local-service)

A 'local' service is used when you can communicate with a service via some kind of local DNS. In that you do not need to call out over the internet to access the service. For example you might be using [Kubernetes DNS](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/).

Before you can create a cloud service you need to ensure the following config options are set (explicitly or via environment variables):

- `transport.branch` - The CI branch. For example master.
- `transport.environment` - The CI environment. For example dev or staging.

Then for each local service, you must define:

- `transport.services.local.SERVICE_NAME.uri` - The URI of the local service.

You can also optionally specify a version of a service:

- `transport.services.local.SERVICE_NAME.version` - The version of the local service.

To create a local service you need to extend the `\LushDigital\MicroserviceAggregatorTransport\Service` class:

```
