pccomponentes/messenger-retry-bundle

Symfony Bundle for retry policy in Symfony Messenger

Installs: 29 580

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 6

Forks: 0

Open Issues: 0

Type:symfony-bundle

v2.0.1 2023-06-29 10:02 UTC

This package is auto-updated.

Last update: 2024-11-11 05:59:10 UTC


README

This is a Bundle to add the ability to choose the retry policy based on the type of message you are trying to process.

Note: Messages should ultimately inherit from Message.

Installation

  1. Install via composer

    composer require pccomponentes/messenger-retry-bundle
  2. Write the bundle configuration file (config/packages/messenger_retry.yaml) indicating the retry policies for each message class and the action you want to execute in each of them. An example of its content is:

    messenger_retry:
      - max_retries: 5
        delay_milliseconds: 2000
        multiplier: 2
        max_delay_milliseconds: 2800000
        msg_types:  
          - PcComponentes\Ddd\Application\Command: auto
        # - PcComponentes\Ddd\Application\Command: always_retry
        # - PcComponentes\Ddd\Application\Command: never_retry

    This file will be modified to add or remove any retry policies needed for the project it is used in.