Download the PHP package adtechpotok/enqueue-messenger-adapter-bundle without Composer
On this page you can find all versions of the php package adtechpotok/enqueue-messenger-adapter-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package enqueue-messenger-adapter-bundle
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.
Usage
-
Install the transport
-
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: -
Configure Messenger's transport (that we will name
amqp
) to use Enqueue'sdefault
transport: -
Route the messages that have to go through the message queue:
- Consume!
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):
Send a message on a specific topic
You can send a message on a specific topic using TransportConfiguration
envelope item with your message:
Message duplication preventing
This package provide deduplication mechanism based on Redis optimistic locking (there is documentation https://redis.io/topics/transactions "Optimistic locking using check-and-set"). It uses two dependencies which you have to implement by yourself.
-
Configure UuidItemSetterMiddleware on produce bus. It will store UUID-4 identifier in envelope items.
- Implement UniqueIdGetterInterface interface and register it as a service.
That interface will be used every time when LockBasedDeduplicationMiddleware will process a message. The method getUniqueId have to return a unique id each time when it will be called. LockBasedDeduplicationMiddleware will try to lock a message by this id. If it succeeds the message will be processed next otherwise you will get an exception.
Example:
- Register redis-locker and deduplication middleware
Where @REDIS_CLIENT is your configured redis client.
- Configure LockBasedDeduplicationMiddleware
All versions of enqueue-messenger-adapter-bundle with dependencies
adtechpotok/messenger-adapter Version 0.1.21
adtechpotok/symfony-aware Version dev-master
enqueue/amqp-bunny Version ^0.8.31
opentracing/opentracing Version 1.0.0-beta5
predis/predis Version ^1.1
queue-interop/queue-interop Version ^0.6.2
ramsey/uuid Version ^3.8
symfony/console Version ~3.4.6|~4.1
symfony/dependency-injection Version ~3.4.6|~4.1
symfony/serializer-pack Version ^1.0