Skip to content

Commit

Permalink
NEXT-31249 - mention overriding transport and lowering the priority
Browse files Browse the repository at this point in the history
  • Loading branch information
MoritzKrafeld committed Oct 30, 2023
1 parent 787def5 commit aecc237
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,32 @@ public function sendMessage(string $message): void
}
```

## Override transport for specific messages

If you explicitly configure a message to be transported via the `async` (default) queue, even though it implements the `LowPriorityMessageInterface` which would usually be transported via the `low_priority` queue, the transport is overridden for this specific message.

Example:
```php
<?php declare(strict_types=1);

namespace Your\Custom;

use Shopware\Core\Framework\MessageQueue\LowPriorityMessageInterface;

class LowPriorityMessage implements LowPriorityMessageInterface
{
}
```

```yaml
# config/packages/framework.yaml
framework:
messenger:
routing:
'Shopware\Core\Framework\MessageQueue\LowPriorityMessageInterface': low_priority
'Your\Custom\LowPriorityMessage': async
```
## Encrypted messages
As the sent messages may travel through some 3rd party services you may want to encrypt messages containing sensible information. To send encrypted messages simply use the `encrypted.messenger.bus.shopware` rather than the `messenger.bus.shopware` message bus. The encrypted bus will handle encryption and decryption for you.
Expand Down

0 comments on commit aecc237

Please sign in to comment.