Skip to content

Commit 0244211

Browse files
committed
Merge pull request #208 from rrehbeindoi/add-keepalive-option
Added keep-alive and heartbeat option to configuration
2 parents 7cc536b + 9f2ff46 commit 0244211

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

DependencyInjection/Configuration.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ protected function addConnections(ArrayNodeDefinition $node)
5353
->scalarNode('password')->defaultValue('guest')->end()
5454
->scalarNode('vhost')->defaultValue('/')->end()
5555
->booleanNode('lazy')->defaultFalse()->end()
56+
->booleanNode('keepalive')->defaultFalse()->info('requires php-amqplib v2.4.1+ and PHP5.4+')->end()
57+
->scalarNode('heartbeat')->defaultValue(0)->info('requires php-amqplib v2.4.1+')->end()
5658
->end()
5759
->end()
5860
->end()

DependencyInjection/OldSoundRabbitMqExtension.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,16 @@ protected function loadConnections()
7979
$connection['port'],
8080
$connection['user'],
8181
$connection['password'],
82-
$connection['vhost']
82+
$connection['vhost'],
83+
false, // insist
84+
'AMQPLAIN', // login_method
85+
null, // login_response
86+
'en_US', // locale
87+
3, // connection_timeout
88+
3, // read_write_timeout
89+
null, // context
90+
$connection['keepalive'],
91+
$connection['heartbeat'],
8392
));
8493

8594
$this->container->setDefinition(sprintf('old_sound_rabbit_mq.connection.%s', $key), $definition);

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,12 @@ old_sound_rabbit_mq:
121121
password: 'guest'
122122
vhost: '/'
123123
lazy: false
124+
125+
# requires php-amqplib v2.4.1+ and PHP5.4+
126+
keepalive: false
127+
128+
# requires php-amqplib v2.4.1+
129+
heartbeat: 0
124130
producers:
125131
upload_picture:
126132
connection: default

0 commit comments

Comments
 (0)