-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmessenger.local.php.dist
More file actions
41 lines (38 loc) · 1.79 KB
/
messenger.local.php.dist
File metadata and controls
41 lines (38 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
declare(strict_types=1);
use Netglue\PsrContainer\Messenger\Container\TransportFactory;
use Psr\Container\ContainerInterface;
use Symfony\Component\Messenger\Transport\Serialization\PhpSerializer;
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface as SymfonySerializer;
return [
'symfony' => [
'messenger' => [
'transports' => [
'redis_transport' => [
'dsn' => 'redis://127.0.0.1:6379/messages',
'serializer' => SymfonySerializer::class,
'retry_strategy' => [
'max_retries' => 3, //maximum number of times a message will be retried after the first failure
'delay' => 1000, // initial delay before retrying a failed message, in milliseconds
'multiplier' => 2, // factor to increase the delay for each subsequent retry
'max_delay' => 0, // maximum delay between retries, in milliseconds
],
],
// separate transport for failed messages
'failed' => [
'dsn' => 'redis://127.0.0.1:6379/failed',
'serializer' => SymfonySerializer::class,
],
],
// tells Messenger that the transport to store failed messages is "failed"
'failure_transport' => 'failed',
],
],
'dependencies' => [
'factories' => [
'redis_transport' => [TransportFactory::class, 'redis_transport'],
'failed' => [TransportFactory::class, 'failed'],
SymfonySerializer::class => fn(ContainerInterface $container) => new PhpSerializer(),
],
],
];