File tree Expand file tree Collapse file tree 12 files changed +49
-31
lines changed
src/Infrastructure/Rabbitmq Expand file tree Collapse file tree 12 files changed +49
-31
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,14 @@ services:
2424 shared : true
2525
2626 App\Infrastructure\Rabbitmq\RabbitmqConnectionInterface : ' @App\Infrastructure\Rabbitmq\RabbitmqConnection'
27+
2728 App\Infrastructure\Rabbitmq\RabbitmqConnection :
2829 public : true
2930 shared : true
31+ arguments :
32+ - ' @rabbitmq.connection'
33+
34+ rabbitmq.connection :
35+ class : PhpAmqpLib\Connection\AMQPStreamConnection
36+ factory : [ 'App\Infrastructure\Rabbitmq\RabbitmqConnectionFactory', 'createConnection' ]
37+ shared : true
Original file line number Diff line number Diff line change 44
55namespace App \Infrastructure \Rabbitmq \Consumer ;
66
7- use App \Infrastructure \Rabbitmq \RabbitmqConnection ;
7+ use App \Infrastructure \Rabbitmq \RabbitmqConnectionInterface ;
88use Symfony \Component \Console \Attribute \AsCommand ;
99use Symfony \Component \Console \Command \Command ;
1010use Symfony \Component \Console \Input \InputInterface ;
@@ -21,7 +21,7 @@ class DirectConsumerCommand extends Command
2121 private const EXCHANGE_NAME = 'e.direct ' ;
2222
2323 public function __construct (
24- protected readonly RabbitmqConnection $ rabbitmqConnection ,
24+ protected readonly RabbitmqConnectionInterface $ rabbitmqConnection ,
2525 ?string $ name = null )
2626 {
2727 parent ::__construct ($ name );
Original file line number Diff line number Diff line change 44
55namespace App \Infrastructure \Rabbitmq \Consumer ;
66
7- use App \Infrastructure \Rabbitmq \RabbitmqConnection ;
7+ use App \Infrastructure \Rabbitmq \RabbitmqConnectionInterface ;
88use Symfony \Component \Console \Attribute \AsCommand ;
99use Symfony \Component \Console \Command \Command ;
1010use Symfony \Component \Console \Input \InputInterface ;
@@ -21,7 +21,7 @@ class FanoutConsumerCommand extends Command
2121 private const QUEUE_NAME = 'q.events-fanout.1 ' ;
2222
2323 public function __construct (
24- protected readonly RabbitmqConnection $ rabbitmqConnection ,
24+ protected readonly RabbitmqConnectionInterface $ rabbitmqConnection ,
2525 ?string $ name = null )
2626 {
2727 parent ::__construct ($ name );
Original file line number Diff line number Diff line change 44
55namespace App \Infrastructure \Rabbitmq \Consumer ;
66
7- use App \Infrastructure \Rabbitmq \RabbitmqConnection ;
7+ use App \Infrastructure \Rabbitmq \RabbitmqConnectionInterface ;
88use PhpAmqpLib \Wire \AMQPTable ;
99use Symfony \Component \Console \Attribute \AsCommand ;
1010use Symfony \Component \Console \Command \Command ;
@@ -22,7 +22,7 @@ class HeaderConsumerCommand extends Command
2222 private const QUEUE_NAME = 'q.events-header ' ;
2323
2424 public function __construct (
25- protected readonly RabbitmqConnection $ rabbitmqConnection ,
25+ protected readonly RabbitmqConnectionInterface $ rabbitmqConnection ,
2626 ?string $ name = null )
2727 {
2828 parent ::__construct ($ name );
Original file line number Diff line number Diff line change 44
55namespace App \Infrastructure \Rabbitmq \Consumer ;
66
7- use App \Infrastructure \Rabbitmq \RabbitmqConnection ;
7+ use App \Infrastructure \Rabbitmq \RabbitmqConnectionInterface ;
88use Symfony \Component \Console \Attribute \AsCommand ;
99use Symfony \Component \Console \Command \Command ;
1010use Symfony \Component \Console \Input \InputInterface ;
@@ -21,7 +21,7 @@ class SecondFanoutConsumerCommand extends Command
2121 private const QUEUE_NAME = 'q.events-fanout.2 ' ;
2222
2323 public function __construct (
24- protected readonly RabbitmqConnection $ rabbitmqConnection ,
24+ protected readonly RabbitmqConnectionInterface $ rabbitmqConnection ,
2525 ?string $ name = null )
2626 {
2727 parent ::__construct ($ name );
Original file line number Diff line number Diff line change 44
55namespace App \Infrastructure \Rabbitmq \Consumer ;
66
7- use App \Infrastructure \Rabbitmq \RabbitmqConnection ;
7+ use App \Infrastructure \Rabbitmq \RabbitmqConnectionInterface ;
88use Symfony \Component \Console \Attribute \AsCommand ;
99use Symfony \Component \Console \Command \Command ;
1010use Symfony \Component \Console \Input \InputInterface ;
@@ -21,7 +21,7 @@ class TopicConsumerCommand extends Command
2121 private const QUEUE_NAME = 'q.events-topic ' ;
2222
2323 public function __construct (
24- protected readonly RabbitmqConnection $ rabbitmqConnection ,
24+ protected readonly RabbitmqConnectionInterface $ rabbitmqConnection ,
2525 ?string $ name = null )
2626 {
2727 parent ::__construct ($ name );
Original file line number Diff line number Diff line change 44
55namespace App \Infrastructure \Rabbitmq \Producer ;
66
7- use App \Infrastructure \Rabbitmq \RabbitmqConnection ;
7+ use App \Infrastructure \Rabbitmq \RabbitmqConnectionInterface ;
88use PhpAmqpLib \Message \AMQPMessage ;
99use Symfony \Component \Console \Attribute \AsCommand ;
1010use Symfony \Component \Console \Command \Command ;
@@ -21,7 +21,7 @@ class DirectProducerCommand extends Command
2121 private const EXCHANGE_NAME = 'e.direct ' ;
2222
2323 public function __construct (
24- protected readonly RabbitmqConnection $ rabbitmqConnection ,
24+ protected readonly RabbitmqConnectionInterface $ rabbitmqConnection ,
2525 string $ name = null
2626 ) {
2727 parent ::__construct ($ name );
Original file line number Diff line number Diff line change 44
55namespace App \Infrastructure \Rabbitmq \Producer ;
66
7- use App \Infrastructure \Rabbitmq \RabbitmqConnection ;
7+ use App \Infrastructure \Rabbitmq \RabbitmqConnectionInterface ;
88use PhpAmqpLib \Message \AMQPMessage ;
99use Symfony \Component \Console \Attribute \AsCommand ;
1010use Symfony \Component \Console \Command \Command ;
@@ -21,7 +21,7 @@ class FanoutProducerCommand extends Command
2121 private const EXCHANGE_NAME = 'e.fanout ' ;
2222
2323 public function __construct (
24- protected readonly RabbitmqConnection $ rabbitmqConnection ,
24+ protected readonly RabbitmqConnectionInterface $ rabbitmqConnection ,
2525 string $ name = null
2626 ) {
2727 parent ::__construct ($ name );
Original file line number Diff line number Diff line change 55namespace App \Infrastructure \Rabbitmq \Producer ;
66
77use App \Infrastructure \Rabbitmq \RabbitmqConnection ;
8+ use App \Infrastructure \Rabbitmq \RabbitmqConnectionInterface ;
89use PhpAmqpLib \Message \AMQPMessage ;
910use PhpAmqpLib \Wire \AMQPTable ;
1011use Symfony \Component \Console \Attribute \AsCommand ;
@@ -22,7 +23,7 @@ class HeaderProducerCommand extends Command
2223 private const EXCHANGE_NAME = 'e.header ' ;
2324
2425 public function __construct (
25- protected readonly RabbitmqConnection $ rabbitmqConnection ,
26+ protected readonly RabbitmqConnectionInterface $ rabbitmqConnection ,
2627 string $ name = null
2728 ) {
2829 parent ::__construct ($ name );
Original file line number Diff line number Diff line change 44
55namespace App \Infrastructure \Rabbitmq \Producer ;
66
7- use App \Infrastructure \Rabbitmq \RabbitmqConnection ;
7+ use App \Infrastructure \Rabbitmq \RabbitmqConnectionInterface ;
88use PhpAmqpLib \Message \AMQPMessage ;
99use Symfony \Component \Console \Attribute \AsCommand ;
1010use Symfony \Component \Console \Command \Command ;
@@ -21,7 +21,7 @@ class TopicProducerCommand extends Command
2121 private const EXCHANGE_NAME = 'e.topic ' ;
2222
2323 public function __construct (
24- protected readonly RabbitmqConnection $ rabbitmqConnection ,
24+ protected readonly RabbitmqConnectionInterface $ rabbitmqConnection ,
2525 string $ name = null
2626 ) {
2727 parent ::__construct ($ name );
You can’t perform that action at this time.
0 commit comments