2017 © Pedro Peláez
 

symfony-bundle activemq-bundle

OverBlog ActiveMQ Bundle

image

overblog/activemq-bundle

OverBlog ActiveMQ Bundle

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 11 Versions
  • 4 % Grown

The README.md

OverblogActiveMqBundle

ActiveMQ Bundle for the Symfony., (*1)

Installation

composer req overblog/activemq-bundle

Usage

Define publishers and consumers:, (*2)

overblog_active_mq:
    connections:
        default:
            user: '%env(MQ_USER)%'
            password: '%env(MQ_PASSWORD)%'
            servers: '%mq_servers%'

    publishers:
        foo:
            connection: default
            options:
                type: queue
                name: foo.notification
        bar:
            connection: default
            options:
                type: queue
                name: bar.notification
    consumers:
        foo:
            connection: default
            handler: App\Consumer\FooConsumer
            options:
                type: queue
                name: foo.notification # queue name
                prefetchSize: 10
        bar:
            connection: default
            handler: App\Consumer\BarConsumer
            options:
                type: queue
                name: bar.notification
                prefetchSize: 10

services:
    App\Consumer\BarConsumer: ~
    App\Consumer\FooConsumer: ~

An example of how to publish a message: you can access publisher using service id overblog_active_mq.{PUBLISHER_NAME} for example overblog_active_mq.foo or overblog_active_mq.bar for above configuration. Services is not public so create a public alias or inject it., (*3)

<?php

namespace App\Controller;

use Overblog\ActiveMqBundle\ActiveMq\Publisher;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

class BazController
{
    public function webhookCallbackAction(Request $request, Publisher $publisher)
    {
        $content = trim($request->getContent());
        $publisher->publish($content);

        return new Response('Successful notification', 200);
    }
}

An example of a consumer:, (*4)

<?php

namespace App\Consumer;

use Overblog\ActiveMqBundle\ActiveMq\ConsumerInterface;
use Overblog\ActiveMqBundle\ActiveMq\Message;

class FooConsumer extends Consumer
{
    /**
     * {@inheritdoc}
     */
    public function execute(Message $message)
    {
        // here you treat your message. Return false to noack the message.
    }
}

The Versions

05/03 2018
05/03 2018
12/10 2016
21/04 2015

1.1.1

1.1.1.0 https://github.com/overblog/ActiveMqBundle.git

OverBlog ActiveMQ Bundle

  Sources   Download

The Requires

 

09/12 2014

1.1

1.1.0.0 https://github.com/overblog/ActiveMqBundle.git

OverBlog ActiveMQ Bundle

  Sources   Download

The Requires

 

08/12 2014

1.0

1.0.0.0 https://github.com/overblog/ActiveMqBundle.git

OverBlog ActiveMQ Bundle

  Sources   Download

The Requires

 

02/06 2014

v0.4

0.4.0.0 https://github.com/overblog/ActiveMqBundle.git

OverBlog ActiveMQ Bundle

  Sources   Download

The Requires

  • php >=5.3.0
  • ext-stomp *

 

29/04 2013

v0.3

0.3.0.0 https://github.com/ebuzzing/OverblogActiveMqBundle.git

OverBlog ActiveMQ Bundle

  Sources   Download

The Requires

  • php >=5.3.0
  • ext-stomp *

 

03/01 2013

v0.2

0.2.0.0 https://github.com/ebuzzing/OverblogActiveMqBundle.git

OverBlog ActiveMQ Bundle

  Sources   Download

The Requires

  • php >=5.3.0
  • ext-stomp *

 

13/11 2012

v0.1

0.1.0.0 https://github.com/ebuzzing/OverblogActiveMqBundle.git

OverBlog ActiveMQ Bundle

  Sources   Download

The Requires

  • php >=5.3.0
  • ext-stomp *