Skip to content

Commit

Permalink
Update messenger config conditionally
Browse files Browse the repository at this point in the history
  • Loading branch information
yceruto committed Dec 28, 2023
1 parent 4a3ab51 commit 2de379e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 22 deletions.
2 changes: 1 addition & 1 deletion config/packages/messenger.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
'messenger' => [
'default_bus' => 'command.bus',
'buses' => [
'command.bus' => [
'command.bus' => 'test' === $containerConfigurator->env() ? [] : [
'middleware' => [
'messenger.middleware.doctrine_transaction',
],
Expand Down
4 changes: 0 additions & 4 deletions config/services/test/book_store.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use App\BookStore\Domain\Repository\BookRepositoryInterface;
use App\BookStore\Infrastructure\Doctrine\DoctrineBookRepository;
use App\BookStore\Infrastructure\InMemory\InMemoryBookRepository;
use App\Shared\Infrastructure\Symfony\Messenger\NullMiddleware;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

return static function (ContainerConfigurator $containerConfigurator): void {
Expand All @@ -24,7 +23,4 @@

$services->set(DoctrineBookRepository::class)
->public();

$services->set('messenger.middleware.doctrine_transaction')
->class(NullMiddleware::class);
};
17 changes: 0 additions & 17 deletions src/Shared/Infrastructure/Symfony/Messenger/NullMiddleware.php

This file was deleted.

0 comments on commit 2de379e

Please sign in to comment.