Skip to content

Commit

Permalink
fix router topic name
Browse files Browse the repository at this point in the history
  • Loading branch information
bendavies committed Mar 30, 2017
1 parent 6aa76f4 commit 4334b16
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
14 changes: 12 additions & 2 deletions pkg/enqueue/Client/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function getRouterProcessorName()
*/
public function createTransportRouterTopicName($name)
{
return trim(strtolower(trim($this->prefix).'.'.trim($name)), '.');
return $this->getQueueName($name);
}

/**
Expand All @@ -113,7 +113,7 @@ public function createTransportRouterTopicName($name)
*/
public function createTransportQueueName($name)
{
return trim(strtolower(trim($this->prefix).'.'.trim($this->appName).'.'.trim($name)), '.');
return $this->getQueueName($name);
}

/**
Expand Down Expand Up @@ -154,4 +154,14 @@ public static function create(
$routerProcessorName ?: 'router'
);
}

/**
* @param string $name
*
* @return string
*/
private function getQueueName($name)
{
return trim(strtolower(trim($this->prefix).'.'.trim($this->appName).'.'.trim($name)), '.');
}
}
2 changes: 1 addition & 1 deletion pkg/enqueue/Tests/Client/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function testShouldCreateRouterTopicName()
'aRouterProcessorName'
);

$this->assertEquals('aprefix.aname', $config->createTransportRouterTopicName('aName'));
$this->assertEquals('aprefix.aapp.aname', $config->createTransportRouterTopicName('aName'));
}

public function testShouldCreateProcessorQueueName()
Expand Down
2 changes: 1 addition & 1 deletion pkg/stomp/Tests/Client/RabbitMqStompDriverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ public function testShouldSetupBroker()
$logger
->expects($this->at(0))
->method('debug')
->with('[RabbitMqStompDriver] Declare router exchange: prefix.routertopic')
->with('[RabbitMqStompDriver] Declare router exchange: prefix.app.routertopic')
;
$logger
->expects($this->at(1))
Expand Down

0 comments on commit 4334b16

Please sign in to comment.