'Retried message are sent to all queues
An an application A we have a consumer of a determined type of messages M. This M type is also consumed for others apps B and C. In the A app, we've set a retry strategy. In the A app, when the Handler throws a non catched exception the message is sent to the delay queues and retried. The problem is that all B and C queues that consumes the M message also receives the retried message.
M message
---> A app Consumer (throws exception)
---> Delay queues for retries (and) ---> B and C queues
Is this the expected behavior ? Is there a way that retried message are only sent to retry queues an not all consuming queues ?
Solution 1:[1]
Period & Cycle
- Copy this formula to cell
C2and copy it down.
=IF(B2<>B1,IF(A2<>A1,CHAR(65),CHAR(CODE(C1)+1)),C1)
Solution 2:[2]
In Excel 365, you could use a spill formula like this:
=CHAR(B2:B15-XLOOKUP(A2:A15,A2:A15,B2:B15)+65)
You could argue that this is less efficient because it uses a lookup so there could be a speed hit with large amounts of data. On the other hand, it could be considered more efficient because it is a single formula and doesn't need to be pulled down.
If you were worried about the speed, you could set the binary search option in xlookup:
=CHAR(B2:B15-XLOOKUP(A2:A15,A2:A15,B2:B15,,2)+65)
(Column A has to be sorted ascending for this to work - I'm fairly sure that where there are duplicates this will still give the first match. However Microsoft are quoted as saying that there is only a slight benefit of using binary search according to this and other articles)
You could make the formula more dynamic:
=CHAR(B2:INDEX(B:B,COUNTA(B:B))-XLOOKUP(A2:INDEX(A:A,COUNTA(A:A)),A2:INDEX(A:A,COUNTA(A:A)),B2:INDEX(B:B,COUNTA(B:B)))+65)
Or using Let
=LET(Period,A2:INDEX(A:A,COUNTA(A:A)),
Cycle,B2:INDEX(B:B,COUNTA(B:B)),
CHAR(Cycle-XLOOKUP(Period,Period,Cycle)+65))
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | VBasic2008 |
| Solution 2 | Tom Sharpe |

