Skip to content

Commit 86315a4

Browse files
authored
Merge pull request #554 from maximetassy/add-network-protocol
Fix #553, add possibility to define network protocol in config
2 parents e93f2f8 + 2aeeb04 commit 86315a4

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,26 @@ If for some reason you don't want the connection lazy you can turn it off by set
509509
],
510510
```
511511

512+
### Network Protocol
513+
514+
By default, the network protocol used for connection is tcp.
515+
If for some reason you want to use another network protocol, you can add the extra value in your config options.
516+
Available protocols : `tcp`, `ssl`, `tls`
517+
518+
```php
519+
'connections' => [
520+
// ...
521+
522+
'rabbitmq' => [
523+
// ...
524+
525+
'network_protocol' => 'tcp',
526+
],
527+
528+
// ...
529+
],
530+
```
531+
512532
### Octane support
513533

514534
Starting with 13.3.0, this package supports [Laravel Octane](https://laravel.com/docs/octane) out of the box.

src/Queue/Connection/ConfigFactory.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public static function make(array $config = []): AMQPConnectionConfig
3737

3838
self::getHostFromConfig($connectionConfig, $config);
3939
self::getHeartbeatFromConfig($connectionConfig, $config);
40+
self::getNetworkProtocolFromConfig($connectionConfig, $config);
4041
});
4142
}
4243

@@ -90,4 +91,11 @@ protected static function getHeartbeatFromConfig(AMQPConnectionConfig $connectio
9091
$connectionConfig->setHeartbeat((int) $heartbeat);
9192
}
9293
}
94+
95+
protected static function getNetworkProtocolFromConfig(AMQPConnectionConfig $connectionConfig, array $config): void
96+
{
97+
if ($networkProtocol = Arr::get($config, 'network_protocol')) {
98+
$connectionConfig->setNetworkProtocol($networkProtocol);
99+
}
100+
}
93101
}

0 commit comments

Comments
 (0)