GithubHelp home page GithubHelp logo

icbaseamqpbundle's Introduction

InstaClick Base Amqp Bundle

Build Status

IMPORTANT NOTICE: This bundle is still under development. Any changes will be done without prior notice to consumers of this package. Of course this code will become stable at a certain point, but for now, use at your own risk.

Introduction

This bundle provides Amqp support to Symfony2 applications.

This bundle requires that you are using, at least, Symfony 2.2.

Installation

Installing this bundle can be done through these simple steps:

  1. Add this bundle to your project as a composer dependency:
    // composer.json
    {
        // ...
        require: {
            // ...
            "instaclick/base-amqp-bundle": "dev-master"
        }
    }
  1. Add this bundle in your application kernel:
    // application/ApplicationKernel.php
    public function registerBundles()
    {
        // ...
        $bundles[] = new IC\Bundle\Base\AmqpBundle\ICBaseAmqpBundle();

        return $bundles;
    }
  1. Double check if the bundle is configured correctly:
# application/config/ic_base_amqp.yml
ic_base_amqp:
    connections:
        default:
            host: '%rabbitmq_host%'
            login: '%rabbitmq_user%'
            password: '%rabbitmq_password%'
            port: '%rabbitmq_port%'
            vhost: '%rabbitmq_vhost%'
            persistent: false
    channels:
        default:
            connection: 'default'
            prefetch_size: 0
            prefetch_count: 1
    exchanges:
        manolo_exchange:
            name: 'manolo_exchange'
            auto_declare: true
            channel: 'default'
            type: 'topic'
    queues:
        manolo_queue:
            name: 'manolo_queue'
            auto_declare: true
            channel: 'default'
            binding:
                exchange: 'manolo_exchange'
                routing_key: 'fancy.routing.key'
  1. Create a service and inject it into the desired service
ic_base_amqp.[{queues,exchanges,channels,connections}].[resource_name]

check the following sample:
$connection = $this->container->get('ic_base_amqp.connections.default');
$channels   = $this->container->get('ic_base_amqp.channels.default');
$exchanges  = $this->container->get('ic_base_amqp.exchanges.manolo_exchange');
$queue      = $this->container->get('ic_base_amqp.queues.manolo_queue');

Usage

Check the PHP-Amqp extension documentation Page for a better undestanding of the AMQP API.

icbaseamqpbundle's People

Contributors

guilhermeblanco avatar kinncj avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.