File tree 1 file changed +6
-5
lines changed
src/Symfony/Component/Messenger/Transport/AmqpExt
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -191,20 +191,21 @@ public function publishForRetry(\AMQPEnvelope $message)
191
191
192
192
// increment the number of attempts
193
193
$ attemptNumber = ((int ) $ message ->getHeader (self ::ATTEMPT_COUNT_HEADER_NAME ) ?: 0 );
194
- ++ $ attemptNumber ;
194
+ $ attemptNumber++ ;
195
195
196
196
// only allow the attemptNumber to go as high as the configure
197
197
// this will avoid unnecessary queues from being created
198
198
$ configuredRetryTtlCount = isset ($ retryConfiguration ['ttl ' ]) ? \count ($ retryConfiguration ['ttl ' ]) - 1 : 0 ;
199
- if ($ attemptNumber > $ configuredRetryTtlCount ) {
200
- $ attemptNumber = $ configuredRetryTtlCount ;
199
+ $ attemptNumberForTtl = $ attemptNumber ;
200
+ if ($ attemptNumberForTtl > $ configuredRetryTtlCount ) {
201
+ $ attemptNumberForTtl = $ configuredRetryTtlCount ;
201
202
}
202
203
203
204
if ($ this ->shouldSetup ()) {
204
- $ this ->setupRetry ($ retryConfiguration , $ attemptNumber );
205
+ $ this ->setupRetry ($ retryConfiguration , $ attemptNumberForTtl );
205
206
}
206
207
207
- $ routingKey = str_replace ('%attempt% ' , $ attemptNumber , $ retryConfiguration ['routing_key_pattern ' ]);
208
+ $ routingKey = str_replace ('%attempt% ' , $ attemptNumberForTtl , $ retryConfiguration ['routing_key_pattern ' ]);
208
209
$ flags = $ this ->queueConfiguration ['flags ' ] ?? AMQP_NOPARAM ;
209
210
$ headers = $ message ->getHeaders ();
210
211
$ headers [self ::ATTEMPT_COUNT_HEADER_NAME ] = $ attemptNumber ;
You can’t perform that action at this time.
0 commit comments