2017 © Pedro Peláez
 

library messenger-filesystem-transport

Symfony Messenger transport for the filesystem.

image

pnz/messenger-filesystem-transport

Symfony Messenger transport for the filesystem.

  • Tuesday, June 19, 2018
  • by thepanz
  • Repository
  • 0 Watchers
  • 2 Stars
  • 174 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Filesystem Transport for Symfony Messenger

Latest Stable Version Total Downloads License Latest Unstable Version Build Status, (*1)

Extends the Symfony Messenger component to handle the filesystem transport. Queues are processed locally by storing and retrieving messages from the filesystem., (*2)

The queuing is implemented as a LIFO (Last-In, First-Out) list, this to optimize the filesystem usage and the r/w operations., (*3)

Install

composer require pnz/messenger-filesystem-transport

This transport handles the filesystem:// schema, use the FilesystemTransportFactory to create the transport., (*4)

Symfony configuration: use the Filesystem Transport Bundle Bundle., (*5)

Install without the Symfony Bundle:

  1. Register the transport factory:
#  config/services.yaml
Pnz\Messenger\FilesystemTransport\FilesystemTransportFactory:
    arguments:
        $serializer: '@messenger.transport.symfony_serializer'
        # The following lines are not needed if "autowire" is enabled
        $filesystem: '@filesystem'
        $lockFactory: '@lock.factory'
    # Enable the `filesystem://` transport to be auto-discovered, this is not needed when "autoconfigure" is enabled
    tags: ['messenger.transport_factory']
  1. Configure the Filesystem transport:
#  config/packages/messenger.yaml
parameters:
  # The path *MUST* specify an absolute path of the directory where the queue will be stored
  # Example1: the queue messages will be stored in the project's `var/queue` directory
  env(MESSENGER_TRANSPORT_DSN): "filesystem://%kernel.project_dir%/var/queue"
  # Example2: use the `/tmp/queue` directory (note the triple `/`)
  env(MESSENGER_TRANSPORT_DSN): "filesystem:///tmp/queue"

framework:
    messenger:
        transports:
            filesystem: '%env(resolve:MESSENGER_TRANSPORT_DSN)%'

        routing:
            App\Message\MyMessage: filesystem

Configuration

The DSN includes the following query parameters:, (*6)

  • compress: Enable/Disable compression of messages storage (gzinflate/gzdeflate), use compress=true (default: false)
  • loop_sleep: Define the sleep interval between loops in micro-seconds, use loop_sleep=MICRO-SECONDS (default: 500000)

Example:, (*7)

# .env

# Enable compression, and sleep for 0.8 seconds during loops if the queue is empty
MESSENGER_TRANSPORT_DSN="filesystem://%kernel.project_dir%/var/queue/default?compress=true&loop_sleep=800000"

The Versions

19/06 2018

dev-master

9999999-dev

Symfony Messenger transport for the filesystem.

  Sources   Download

MIT

The Requires

 

The Development Requires

filesystem symfony queue messenger

19/06 2018

v0.1.2

0.1.2.0

Symfony Messenger transport for the filesystem.

  Sources   Download

MIT

The Requires

 

The Development Requires

filesystem symfony queue messenger

08/06 2018

v0.1.1

0.1.1.0

Symfony Messenger transport for the filesystem.

  Sources   Download

MIT

The Requires

 

The Development Requires

filesystem symfony queue messenger

08/06 2018

v0.1.0

0.1.0.0

Symfony Messenger transport for the filesystem.

  Sources   Download

MIT

The Requires

 

The Development Requires

filesystem symfony queue messenger