Skip to content

Added channel_rpc_timeout as possible option #700

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ protected function addConnections(ArrayNodeDefinition $node)
->booleanNode('lazy')->defaultFalse()->end()
->scalarNode('connection_timeout')->defaultValue(3)->end()
->scalarNode('read_write_timeout')->defaultValue(3)->end()
->scalarNode('channel_rpc_timeout')->defaultValue(0.0)->end()
->booleanNode('use_socket')->defaultValue(false)->end()
->arrayNode('ssl_context')
->useAttributeAsKey('key')
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ old_sound_rabbit_mq:
lazy: false
connection_timeout: 3
read_write_timeout: 3

# the timeout when waiting for a response from rabbitMQ (0.0 means waits forever)
channel_rpc_timeout: 0.0

# requires php-amqplib v2.4.1+ and PHP5.4+
keepalive: false
Expand Down
1 change: 1 addition & 0 deletions RabbitMq/AMQPConnectionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class AMQPConnectionFactory
'keepalive' => false,
'heartbeat' => 0,
'hosts' => [],
'channel_rpc_timeout' => 0.0
];

/**
Expand Down
6 changes: 6 additions & 0 deletions Tests/RabbitMq/AMQPConnectionFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ public function testSSLConnectionParameters()
'context' => null, // context checked earlier
'keepalive' => false,
'heartbeat' => 0,
'channel_rpc_timeout' => 0.0,
],
], $instance->constructParams);
}
Expand Down Expand Up @@ -351,6 +352,7 @@ public function testClusterConnectionParametersWithoutRootConnectionKeys()
'ssl_context' => null,
'keepalive' => false,
'heartbeat' => 0,
'channel_rpc_timeout' => 0.0,
],
],
$instance::$createConnectionParams
Expand Down Expand Up @@ -422,6 +424,7 @@ public function testClusterConnectionParametersWithRootConnectionKeys()
'ssl_context' => null,
'keepalive' => false,
'heartbeat' => 0,
'channel_rpc_timeout' => 0.0,
],
],
$instance::$createConnectionParams
Expand Down Expand Up @@ -500,6 +503,7 @@ public function testSSLClusterConnectionParameters()
'context' => null,
'keepalive' => false,
'heartbeat' => 0,
'channel_rpc_timeout' => 0.0,
],
], $instance->constructParams);

Expand Down Expand Up @@ -534,6 +538,7 @@ public function testSSLClusterConnectionParameters()
'context' => null, // context checked earlier
'keepalive' => false,
'heartbeat' => 0,
'channel_rpc_timeout' => 0.0,
],
],
$instance::$createConnectionParams
Expand Down Expand Up @@ -611,6 +616,7 @@ public function testSocketClusterConnectionParameters()
'read_write_timeout' => 3,
'read_timeout' => 3,
'write_timeout' => 3,
'channel_rpc_timeout' => 0.0,
],
],
$instance::$createConnectionParams
Expand Down