How Bypass FLR and SLR by code

85 views
Skip to first unread message

Mauricio Kiniz

unread,
Sep 14, 2015, 9:20:13 AM9/14/15
to Particular Software
Helpful information to include
Product name:
Version:
Stacktrace:
Description:

Helpful information to include
Product name: NServiceBus
Version: 5.2.0
Stacktrace: none
Description:

Scenario
I have a component that receives a set of documents. This group of documents has to be performed individually in a queue selected by the parametrized configuration, 
which may be different from the current one. The answer to the component that originally received the message must be grouped at the end of processing of all documents.

Proposed solution.
Implement the design pattern Composite Processor. Where the initial message is parameterized a splitter that will break the message into your documents after a 
MessageRouter that will determine which queues that these documents should be processed and end an aggregator will need to group all returns in a single message. 
Thus it was made implementations and is posted a message for each document and another control message. The message control when run, 
checks that all the group's messages have already been processed and if so runs the aggregator to aggregate the responses of group messages. 
If not it calls the Defer putting the message on hold for a while. 
This waiting process is parameterized both the wait time as the number of attempts. 
When the number of attempts is exceeded is generated a default exception to my CompositeProcessorException that goes into the error queue
This processing queue is monitored in real time by a team of the company. 
I would like to continue using the error queue as a central location for monitoring problems in the solution when it is distributed processing.
With this solution in hand I came across a problem. The FLR and the component SLR. 
In this case I know it's no longer necessary to run the component for my error condition has been reached and will not change. 
Although you can disable the FLR and SLR is not interesting since in the same processing queue are executed other messages, 
and even the control component can have problems that the intermediate FLR and SLR solved very well. 
But when she reaches the point where it should no longer be reprocessed it must go directly to the error queue and not go through the FLR and SLR cycle as set out in the NServiceBus behavior.

Question.
How do I prevent both FLR as the SLR are executed in the case noted above?

Sean Feldman

unread,
Sep 14, 2015, 6:41:25 PM9/14/15
to Particular Software
Hi Mauricio,

Are you looking to disable SLR/FLR per message message or instance?

If you want to disabled based on certain message types, you could direct those to a different endpoint that have a different configuration (FLA/SLA disabled)?
Failing messages would still go to error queue, but without retries.

For SLR only, you can inject a custom policy (http://docs.particular.net/nservicebus/errors/automatic-retries#second-level-retries-custom-retry-policy), but you'd need to inspect headers to verify message type. Otherwise policy would be executed on all SLR retries for all message types.
Reply all
Reply to author
Forward
0 new messages