Commit c6bbff0
committed
bug symfony#59513 [Messenger ] Extract retry delay from nested
This PR was merged into the 7.2 branch.
Discussion
----------
[Messenger ] Extract retry delay from nested `RecoverableExceptionInterface`
| Q | A
| ------------- | ---
| Branch? | 7.2
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | n/a
| License | MIT
Hey,
In symfony#57915 the ability to add a retry delay to `RecoverableExceptionInterface` was implemented. However, I noticed while debugging that it in my case the custom delay was not being applied because `RecoverableExceptionInterface` is wrapped in a `HandlerFailedException` in: https://github.com/symfony/symfony/blob/7a16efefdee2d282cd6ccfd6ecb0b82ff5a06936/src/Symfony/Component/Messenger/Middleware/HandleMessageMiddleware.php#L124
For detecting whether we should retry we already unwrap `HandlerFailedException` so I implemented a similar method to fetch the delay, simply getting it from the first `RecoverableExceptionInterface`.
Maybe we need something more advanced, so your feedback there would be appreciated!
Commits
-------
4a02222 [Messenger ] Extract retry delay from nested `RecoverableExceptionInterface`RecoverableExceptionInterface (AydinHassan)File tree
2 files changed
+82
-6
lines changed- src/Symfony/Component/Messenger
- EventListener
- Tests/EventListener
2 files changed
+82
-6
lines changedLines changed: 25 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
| 66 | + | |
72 | 67 | | |
73 | 68 | | |
74 | 69 | | |
| |||
148 | 143 | | |
149 | 144 | | |
150 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
151 | 170 | | |
152 | 171 | | |
153 | 172 | | |
| |||
Lines changed: 57 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
111 | 168 | | |
112 | 169 | | |
113 | 170 | | |
| |||
0 commit comments