Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public function onPreReceived(Context $context)
}

$config = $this->driver->getConfig();
if ($context->getPsrQueue()->getQueueName() != $config->createTransportQueueName($config->getRouterQueueName())) {
$queue = $this->driver->createQueue($config->getRouterQueueName());
if ($context->getPsrQueue()->getQueueName() != $queue->getQueueName()) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public function testCouldBeConstructedWithRequiredArguments()
public function testShouldSetRouterProcessorPropertyIfNotSetAndOnRouterQueue()
{
$config = Config::create('test', '', '', 'router-queue', '', 'router-processor-name');
$queue = new NullQueue('test.router-queue');

$driver = $this->createDriverMock();
$driver
Expand All @@ -38,6 +39,12 @@ public function testShouldSetRouterProcessorPropertyIfNotSetAndOnRouterQueue()
->willReturn($config)
;

$driver
->expects($this->once())
->method('createQueue')
->willReturn($queue)
;

$message = new NullMessage();

$context = new Context($this->createPsrContextMock());
Expand All @@ -56,6 +63,7 @@ public function testShouldSetRouterProcessorPropertyIfNotSetAndOnRouterQueue()
public function testShouldNotSetRouterProcessorPropertyIfNotSetAndNotOnRouterQueue()
{
$config = Config::create('test', '', '', 'router-queue', '', 'router-processor-name');
$queue = new NullQueue('test.router-queue');

$driver = $this->createDriverMock();
$driver
Expand All @@ -64,6 +72,12 @@ public function testShouldNotSetRouterProcessorPropertyIfNotSetAndNotOnRouterQue
->willReturn($config)
;

$driver
->expects($this->once())
->method('createQueue')
->willReturn($queue)
;

$message = new NullMessage();

$context = new Context($this->createPsrContextMock());
Expand Down