Public | Automated Build

Last pushed: a year ago
Short Description
Arpanet - API Gateway
Full Description

Arpanet - API Gateway

API Gateway baseada no microframework Silex com ferramentas de teste, integração ao RabbitMQ para chamadas assincronas e cliente HTTP Guzzle para chamada síncronas e enviar chamadas de retorno.

Um servidor RabbitMQ é nescessário para gerenciar as chamadas assíncronas.

Caso de uso:

  1. Controller Receive an HTTP request with an operation id, parameters and a callback URL. Response Working on it.
  2. Manager Construct the operation.
  3. Producer Send a message with the operation to the RabbitMQ server queue.
  4. Consumer's Consume the message from the RabbitMQ server queue.
  5. Manager Process the operation and send an HTTP request to the callback URL with the operation result.

Consumers are running processes that keep listening to the queue messages.
A console command bin/console app:consumer is provided to launch consumers and delegate the operation process logic to the manager but a really simple script is all that is needed to launch a consumer. If your consumers are external to the app, you may put the operation process logic in them.


    bin/       <- Executáveis (console, behat, ...)
    config/    <- Configurações de ambiente
    features/  <- Behat features
    spec/      <- PHPSpec specs
    src/       <- Code, default namespace
    tests/     <- PHPUnit tests
    public/    <- Pasta web pública
config/        <- Configurações adicionais


  1. composer install
  2. Edit the config files and configure the RabbitMQ server parameters.
  3. Point your virtual host to the public\ folder.
  4. Edit behat.yml.dist and replace the base_url value with your virtual host.


A simple example is provided for each testing tool:

  • Behat: features/example.feature
  • PHPSpec: spec/ExampleSpec.php
  • PHPUnit: tests/ExampleTest.php

Run them with:

bin/behat --format pretty
bin/phpspec run --format pretty


Copyright (C) WeDev Brasil - Todos os direitos reservados LICENSE.

Docker Pull Command
Source Repository