Skip to content

Commit 4a11d75

Browse files
committed
LaravelAmqp\Connectors\AmqpConnector - vhost bugfix (if vhost is not defined in configuration, it is assumed to be '/')
1 parent ed12c3a commit 4a11d75

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Connectors/AmqpConnector.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@ class AmqpConnector implements ConnectorInterface
2222
*/
2323
public function connect(array $config)
2424
{
25-
$connection = new AMQPConnection($config['host'], $config['port'], $config['user'], $config['password'], $config['vhost']);
25+
$connection = new AMQPConnection(
26+
$config['host'],
27+
$config['port'],
28+
$config['user'],
29+
$config['password'],
30+
isset($config['vhost']) ? $config['vhost'] : '/'
31+
);
2632

2733
if (!isset($config['exchange_type'])) {
2834
$config['exchange_type'] = AMQPQueue::EXCHANGE_TYPE_DIRECT;

0 commit comments

Comments
 (0)