diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 844d5665..503ecd9e 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -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') diff --git a/README.md b/README.md index ce0b8c18..18ec3e0b 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/RabbitMq/AMQPConnectionFactory.php b/RabbitMq/AMQPConnectionFactory.php index 463856bd..59db599e 100644 --- a/RabbitMq/AMQPConnectionFactory.php +++ b/RabbitMq/AMQPConnectionFactory.php @@ -26,6 +26,7 @@ class AMQPConnectionFactory 'keepalive' => false, 'heartbeat' => 0, 'hosts' => [], + 'channel_rpc_timeout' => 0.0 ]; /** diff --git a/Tests/RabbitMq/AMQPConnectionFactoryTest.php b/Tests/RabbitMq/AMQPConnectionFactoryTest.php index f7a2f6d6..deb93082 100644 --- a/Tests/RabbitMq/AMQPConnectionFactoryTest.php +++ b/Tests/RabbitMq/AMQPConnectionFactoryTest.php @@ -277,6 +277,7 @@ public function testSSLConnectionParameters() 'context' => null, // context checked earlier 'keepalive' => false, 'heartbeat' => 0, + 'channel_rpc_timeout' => 0.0, ], ], $instance->constructParams); } @@ -351,6 +352,7 @@ public function testClusterConnectionParametersWithoutRootConnectionKeys() 'ssl_context' => null, 'keepalive' => false, 'heartbeat' => 0, + 'channel_rpc_timeout' => 0.0, ], ], $instance::$createConnectionParams @@ -422,6 +424,7 @@ public function testClusterConnectionParametersWithRootConnectionKeys() 'ssl_context' => null, 'keepalive' => false, 'heartbeat' => 0, + 'channel_rpc_timeout' => 0.0, ], ], $instance::$createConnectionParams @@ -500,6 +503,7 @@ public function testSSLClusterConnectionParameters() 'context' => null, 'keepalive' => false, 'heartbeat' => 0, + 'channel_rpc_timeout' => 0.0, ], ], $instance->constructParams); @@ -534,6 +538,7 @@ public function testSSLClusterConnectionParameters() 'context' => null, // context checked earlier 'keepalive' => false, 'heartbeat' => 0, + 'channel_rpc_timeout' => 0.0, ], ], $instance::$createConnectionParams @@ -611,6 +616,7 @@ public function testSocketClusterConnectionParameters() 'read_write_timeout' => 3, 'read_timeout' => 3, 'write_timeout' => 3, + 'channel_rpc_timeout' => 0.0, ], ], $instance::$createConnectionParams