Skip to content

Commit 2aac527

Browse files
committed
Merge pull request #56 from desyncr/retries-delay-option
Added configuration option for `retries_delay` IronMQ option.
2 parents 4644873 + 5f10ba6 commit 2aac527

3 files changed

Lines changed: 46 additions & 39 deletions

File tree

src/DependencyInjection/Configuration.php

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -119,36 +119,41 @@ private function getQueuesNode()
119119
->defaultFalse()
120120
->info('Whether notifications are sent to the subscribers')
121121
->end()
122-
->scalarNode('notification_retries')
123-
->defaultValue(3)
124-
->info('How many attempts the Push Notifications are retried if the Subscriber returns an error')
125-
->example(3)
126-
->end()
127-
->scalarNode('message_delay')
128-
->defaultValue(0)
129-
->info('How many seconds before messages are inititally visible in the Queue')
130-
->example(0)
131-
->end()
132-
->scalarNode('message_timeout')
133-
->defaultValue(30)
134-
->info('How many seconds the Queue hides a message while its being processed')
135-
->example(30)
136-
->end()
137-
->scalarNode('message_expiration')
138-
->defaultValue(604800)
139-
->info('How many seconds a message is kept in Queue, the default is 7 days (604800 seconds)')
140-
->example(604800)
141-
->end()
142-
->scalarNode('messages_to_receive')
143-
->defaultValue(1)
144-
->info('Max amount of messages to receive at once - an event will be fired for each individually')
145-
->example(1)
146-
->end()
147-
->scalarNode('receive_wait_time')
148-
->defaultValue(3)
149-
->info('How many seconds to Long Poll when requesting messages - if supported')
150-
->example(3)
151-
->end()
122+
->scalarNode('notification_retries')
123+
->defaultValue(3)
124+
->info('How many attempts the Push Notifications are retried if the Subscriber returns an error')
125+
->example(3)
126+
->end()
127+
->scalarNode('notification_retry_delay')
128+
->defaultValue(60)
129+
->info('Delay between each Push Notification retry in seconds')
130+
->example(3)
131+
->end()
132+
->scalarNode('message_delay')
133+
->defaultValue(0)
134+
->info('How many seconds before messages are inititally visible in the Queue')
135+
->example(0)
136+
->end()
137+
->scalarNode('message_timeout')
138+
->defaultValue(30)
139+
->info('How many seconds the Queue hides a message while its being processed')
140+
->example(30)
141+
->end()
142+
->scalarNode('message_expiration')
143+
->defaultValue(604800)
144+
->info('How many seconds a message is kept in Queue, the default is 7 days (604800 seconds)')
145+
->example(604800)
146+
->end()
147+
->scalarNode('messages_to_receive')
148+
->defaultValue(1)
149+
->info('Max amount of messages to receive at once - an event will be fired for each individually')
150+
->example(1)
151+
->end()
152+
->scalarNode('receive_wait_time')
153+
->defaultValue(3)
154+
->info('How many seconds to Long Poll when requesting messages - if supported')
155+
->example(3)
156+
->end()
152157
->append($this->getSubscribersNode())
153158
->end()
154159
->end()

src/Provider/IronMqProvider.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public function create()
7272
$params = [
7373
'push_type' => 'multicast',
7474
'retries' => $this->options['notification_retries'],
75+
'retry_delay' => $this->options['notification_retry_delay'],
7576
'subscribers' => []
7677
];
7778

tests/Provider/IronMqProviderTest.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,16 @@ private function getIronMqProvider(array $options = [])
5858
{
5959
$options = array_merge(
6060
[
61-
'logging_enabled' => false,
62-
'push_notifications' => true,
63-
'notification_retries' => 3,
64-
'message_delay' => 0,
65-
'message_timeout' => 30,
66-
'message_expiration' => 604800,
67-
'messages_to_receive' => 1,
68-
'receive_wait_time' => 3,
69-
'subscribers' => [
61+
'logging_enabled' => false,
62+
'push_notifications' => true,
63+
'notification_retries' => 3,
64+
'notification_retry_delay' => 60,
65+
'message_delay' => 0,
66+
'message_timeout' => 30,
67+
'message_expiration' => 604800,
68+
'messages_to_receive' => 1,
69+
'receive_wait_time' => 3,
70+
'subscribers' => [
7071
[ 'protocol' => 'http', 'endpoint' => 'http://fake.com' ]
7172
]
7273
],

0 commit comments

Comments
 (0)