Skip to content

Commit 4334b16

Browse files
committed
fix router topic name
1 parent 6aa76f4 commit 4334b16

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

pkg/enqueue/Client/Config.php

+12-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function getRouterProcessorName()
103103
*/
104104
public function createTransportRouterTopicName($name)
105105
{
106-
return trim(strtolower(trim($this->prefix).'.'.trim($name)), '.');
106+
return $this->getQueueName($name);
107107
}
108108

109109
/**
@@ -113,7 +113,7 @@ public function createTransportRouterTopicName($name)
113113
*/
114114
public function createTransportQueueName($name)
115115
{
116-
return trim(strtolower(trim($this->prefix).'.'.trim($this->appName).'.'.trim($name)), '.');
116+
return $this->getQueueName($name);
117117
}
118118

119119
/**
@@ -154,4 +154,14 @@ public static function create(
154154
$routerProcessorName ?: 'router'
155155
);
156156
}
157+
158+
/**
159+
* @param string $name
160+
*
161+
* @return string
162+
*/
163+
private function getQueueName($name)
164+
{
165+
return trim(strtolower(trim($this->prefix).'.'.trim($this->appName).'.'.trim($name)), '.');
166+
}
157167
}

pkg/enqueue/Tests/Client/ConfigTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function testShouldCreateRouterTopicName()
7373
'aRouterProcessorName'
7474
);
7575

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

7979
public function testShouldCreateProcessorQueueName()

pkg/stomp/Tests/Client/RabbitMqStompDriverTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ public function testShouldSetupBroker()
528528
$logger
529529
->expects($this->at(0))
530530
->method('debug')
531-
->with('[RabbitMqStompDriver] Declare router exchange: prefix.routertopic')
531+
->with('[RabbitMqStompDriver] Declare router exchange: prefix.app.routertopic')
532532
;
533533
$logger
534534
->expects($this->at(1))

0 commit comments

Comments
 (0)