Skip to content

Commit b4fbb14

Browse files
authored
Merge pull request #61 from doshu/master
added support for simply using different queue than default
2 parents ee88486 + c5536b5 commit b4fbb14

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/QueueManager.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,26 @@ public static function setConfig($key, $config = null): void
9898
throw new BadMethodCallException('Must specify `url` key.');
9999
}
100100

101+
if (!empty($config['queue'])) {
102+
if (!is_array($config['url'])) {
103+
$config['url'] = [
104+
'transport' => $config['url'],
105+
'client' => [
106+
'router_topic' => $config['queue'],
107+
'router_queue' => $config['queue'],
108+
'default_queue' => $config['queue'],
109+
],
110+
];
111+
} else {
112+
$clientConfig = $config['url']['client'] ?? [];
113+
$config['url']['client'] = $clientConfig + [
114+
'router_topic' => $config['queue'],
115+
'router_queue' => $config['queue'],
116+
'default_queue' => $config['queue'],
117+
];
118+
}
119+
}
120+
101121
/** @psalm-suppress InvalidPropertyAssignmentValue */
102122
static::$_config[$key] = $config;
103123
}

0 commit comments

Comments
 (0)