Skip to content

Commit

Permalink
Move network_protocol up in the config object and document available …
Browse files Browse the repository at this point in the history
…protocols
  • Loading branch information
maximetassy committed Jul 12, 2023
1 parent f864aa8 commit 2aeeb04
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ If for some reason you don't want the connection lazy you can turn it off by set

By default, the network protocol used for connection is tcp.
If for some reason you want to use another network protocol, you can add the extra value in your config options.
Available protocols : `tcp`, `ssl`, `tls`

```php
'connections' => [
Expand All @@ -521,11 +522,7 @@ If for some reason you want to use another network protocol, you can add the ext
'rabbitmq' => [
// ...

'options' => [
// ...

'network_protocol' => 'network wanted',
],
'network_protocol' => 'tcp',
],

// ...
Expand Down
2 changes: 1 addition & 1 deletion src/Queue/Connection/ConfigFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ protected static function getHeartbeatFromConfig(AMQPConnectionConfig $connectio

protected static function getNetworkProtocolFromConfig(AMQPConnectionConfig $connectionConfig, array $config): void
{
if ($networkProtocol = Arr::get($config, self::CONFIG_OPTIONS.'.network_protocol')) {
if ($networkProtocol = Arr::get($config, 'network_protocol')) {
$connectionConfig->setNetworkProtocol($networkProtocol);
}
}
Expand Down

0 comments on commit 2aeeb04

Please sign in to comment.