2017 © Pedro Peláez
 

symfony-bundle messenger-adapter

Enqueue adapter for Symfony Messenger component

image

adtechpotok/messenger-adapter

Enqueue adapter for Symfony Messenger component

  • Friday, July 27, 2018
  • by scarbo87
  • Repository
  • 1 Watchers
  • 0 Stars
  • 40 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 7 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

Enqueue's transport for Symfony Messenger component

This Symfony Messenger transport allows you to use Enqueue to send and receive your messages from all the supported brokers., (*1)

Usage

  1. Install the transport
composer req enqueue/messenger-adapter
  1. Configure the Enqueue bundle as you would normaly do (see Enqueue's Bundle documentation). If you are using the recipes, you should just have to configure the environment variables to configure the default Enqueue transport:
# .env
# ...

###> enqueue/enqueue-bundle ###
ENQUEUE_DSN=amqp://guest:guest@localhost:5672/%2f
###< enqueue/enqueue-bundle ###
  1. Configure Messenger's transport (that we will name amqp) to use Enqueue's default transport:
# config/packages/messenger.yaml
framework:
    messenger:
        transports:
            amqp: enqueue://default
  1. Route the messages that have to go through the message queue:
# config/packages/framework.yaml
framework:
    messenger:
        # ...

        routing:
            'App\Message\MyMessage': amqp
  1. Consume!
bin/console messenger:consume-messages amqp

Advanced usage

Configure the queue(s) and exchange(s)

In the transport DSN, you can add extra configuration. Here is the reference DSN (note that the values are just for the example):, (*2)

enqueue://default
    ?queue[routingKey][name]=queue_name
    &topic[name]=topic_name
    &topic[type]=topic|fanout|direct
    &deliveryDelay=1800
    &delayStrategy=Enqueue\AmqpTools\RabbitMqDelayPluginDelayStrategy
    &timeToLive=3600
    &receiveTimeout=1000
    &priority=1

Send a message on a specific topic

You can send a message on a specific topic using TransportConfiguration envelope item with your message:, (*3)

use Enqueue\MessengerAdapter\EnvelopeItem\TransportConfiguration;

// ...

$this->bus->dispatch((new Envelope($message))->with(new TransportConfiguration(
    ['topic' => 'specific-topic']
)));

The Versions

27/07 2018

dev-feature/more-5452

dev-feature/more-5452 http://symfony.com

Enqueue adapter for Symfony Messenger component

  Sources   Download

MIT

The Requires

 

The Development Requires

symfony messenger enqueue

08/05 2018

0.1.0

0.1.0.0 http://symfony.com

Enqueue adapter for Symfony Messenger component

  Sources   Download

MIT

The Requires

 

The Development Requires

symfony messenger enqueue