Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -747,9 +747,6 @@ there are constraint violations:
)]
UploadedFile $document

.. versionadded:: 7.1

The ``#[MapUploadedFile]`` attribute was introduced in Symfony 7.1.

.. _controller_map-request-header:

Expand Down
43 changes: 43 additions & 0 deletions messenger.rst
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,49 @@
If you don't want to reset the container, add the ``--no-reset`` option when
running the ``messenger:consume`` command.

Custom Message Execution Strategy
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. versionadded:: 8.1

The ``MessageExecutionStrategyInterface`` was introduced in Symfony 8.1.

By default, the worker processes messages synchronously using
:class:`Symfony\\Component\\Messenger\\Execution\\SyncMessageExecutionStrategy`.
You can customize how messages are executed by implementing
:class:`Symfony\\Component\\Messenger\\Execution\\MessageExecutionStrategyInterface`
and passing it to the ``Worker`` constructor::

use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Execution\MessageExecutionStrategyInterface;

class MyCustomExecutionStrategy implements MessageExecutionStrategyInterface
{
public function execute(Envelope $envelope, string $transportName, callable $onHandled): void
{
// custom execution logic (e.g. parallel processing)
}

public function shouldPauseConsumption(): bool
{
return false;
}

public function wait(callable $onHandled): bool
{
return false;
}

public function flush(callable $onHandled, bool|float $force = false): bool
{
return false;
}

public function shutdown(): void
{
}
}

.. _messenger-retries-failures:

Rate Limited Transport
Expand Down Expand Up @@ -1020,7 +1063,7 @@
async_priority_high:
dsn: '%env(MESSENGER_TRANSPORT_DSN)%'

# retry strategy configuration

Check failure on line 1066 in messenger.rst

View workflow job for this annotation

GitHub Actions / Code Blocks

[Missing class] Class, interface or trait with name "Symfony\Component\Messenger\Execution\MessageExecutionStrategyInterface" does not exist
retry_strategy:
max_retries: 3
# time to wait before the first retry (in milliseconds)
Expand Down
Loading