2017 © Pedro Peláez
 

symfony-bundle rabbitmq-sql-bundle

RabbitMQ to sql consumer, using doctrine/dbal and php-amqplib/rabbitmq-bundle

image

florianajir/rabbitmq-sql-bundle

RabbitMQ to sql consumer, using doctrine/dbal and php-amqplib/rabbitmq-bundle

  • Monday, January 22, 2018
  • by florianajir
  • Repository
  • 2 Watchers
  • 1 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Rabbitmq-sql-worker

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require, (*1)

Code Coverage Scrutinizer Code Quality, (*2)

About

The RabbitMqSqlBundle is a symfony worker to provide rabbitmq message persistence for your application using the php-amqplib/rabbitmq-bundle and doctrine/dbal libraries., (*3)

You just need to configure the mapping in yml and execute a command, a simple and scalable rabbitmq to sql consumer to persist your entities:, (*4)

php app/console rabbitmq:consumer -w sql

Features

  • mapping yml config (doctrine like)
  • Insert records
  • Update records
  • Relational records : oneToOne, oneToMany, manyToOne, manyToMany
  • Update, Delete relations
  • Foreign keys support

Examples

Following example shows you the consuming process to persist in database a simple subscriber from an asynchronous message data., (*5)

RabbitMQ incoming message data:, (*6)

{
  "name" : "Rogger Rabbit",
  "email" : "subscriber@acme.corp",
  "Groups": [ { "slug": "subscriber" } ]
}

SQL requests output:, (*7)

INSERT INTO `members` (`name`, `email`) VALUES ("Rogger Rabbit", "subscriber@acme.corp");
INSERT INTO `member_group` (`member_id`, `group_id`) VALUES (3, 2);

Take more inspiration from Examples documentation, (*8)

License

This application is under the MIT license. See the complete license in this file :, (*9)

Resources/meta/LICENSE

Installation

For Symfony Framework >= 2.3

Require the worker and its dependencies with composer:, (*10)

$ composer require florianajir/rabbitmq-sql-worker

Register this bundles:, (*11)

// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        new OldSound\RabbitMqBundle\OldSoundRabbitMqBundle(),
        new FlorianAjir\RabbitMqSqlBundle\FlorianAjirRabbitMqSqlBundle(),
    );
}

Configuration

You have to configure the rabbitmq and the database and define message structures and database mapping., (*12)

Enjoy !, (*13)

The Versions