Skip to content

Commit db70eb7

Browse files
authored
Added channel_rpc_timeout as possible option (#700)
* Added channel_rpc_timeout as possible option * This should fix the failing tests. * Added default value for channel_rpc_timeout in config treebuilder * Update README with channel_rpc_timeout * Apply suggestions from code review
1 parent 985f77d commit db70eb7

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

DependencyInjection/Configuration.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ protected function addConnections(ArrayNodeDefinition $node)
9292
->booleanNode('lazy')->defaultFalse()->end()
9393
->scalarNode('connection_timeout')->defaultValue(3)->end()
9494
->scalarNode('read_write_timeout')->defaultValue(3)->end()
95+
->scalarNode('channel_rpc_timeout')->defaultValue(0.0)->end()
9596
->booleanNode('use_socket')->defaultValue(false)->end()
9697
->arrayNode('ssl_context')
9798
->useAttributeAsKey('key')

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ old_sound_rabbit_mq:
113113
lazy: false
114114
connection_timeout: 3
115115
read_write_timeout: 3
116+
117+
# the timeout when waiting for a response from rabbitMQ (0.0 means waits forever)
118+
channel_rpc_timeout: 0.0
116119

117120
# requires php-amqplib v2.4.1+ and PHP5.4+
118121
keepalive: false

RabbitMq/AMQPConnectionFactory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class AMQPConnectionFactory
2626
'keepalive' => false,
2727
'heartbeat' => 0,
2828
'hosts' => [],
29+
'channel_rpc_timeout' => 0.0
2930
];
3031

3132
/**

Tests/RabbitMq/AMQPConnectionFactoryTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ public function testSSLConnectionParameters()
284284
'context' => null, // context checked earlier
285285
'keepalive' => false,
286286
'heartbeat' => 0,
287+
'channel_rpc_timeout' => 0.0,
287288
],
288289
], $instance->constructParams);
289290
}
@@ -359,6 +360,7 @@ public function testClusterConnectionParametersWithoutRootConnectionKeys()
359360
'ssl_context' => null,
360361
'keepalive' => false,
361362
'heartbeat' => 0,
363+
'channel_rpc_timeout' => 0.0,
362364
],
363365
],
364366
$instance::$createConnectionParams
@@ -431,6 +433,7 @@ public function testClusterConnectionParametersWithRootConnectionKeys()
431433
'ssl_context' => null,
432434
'keepalive' => false,
433435
'heartbeat' => 0,
436+
'channel_rpc_timeout' => 0.0,
434437
],
435438
],
436439
$instance::$createConnectionParams
@@ -509,6 +512,7 @@ public function testSSLClusterConnectionParameters()
509512
'context' => null,
510513
'keepalive' => false,
511514
'heartbeat' => 0,
515+
'channel_rpc_timeout' => 0.0,
512516
],
513517
], $instance->constructParams);
514518

@@ -543,6 +547,7 @@ public function testSSLClusterConnectionParameters()
543547
'context' => null, // context checked earlier
544548
'keepalive' => false,
545549
'heartbeat' => 0,
550+
'channel_rpc_timeout' => 0.0,
546551
],
547552
],
548553
$instance::$createConnectionParams
@@ -621,6 +626,7 @@ public function testSocketClusterConnectionParameters()
621626
'read_write_timeout' => 3,
622627
'read_timeout' => 3,
623628
'write_timeout' => 3,
629+
'channel_rpc_timeout' => 0.0,
624630
],
625631
],
626632
$instance::$createConnectionParams

0 commit comments

Comments
 (0)