Skip to content

Commit dab7d03

Browse files
NCS Doc Review - Error handling / automatic retry sample
Update review date Minor improvements for clarity Minor lint issues fixed
2 parents 909f1ec + 4709b46 commit dab7d03

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

samples/errorhandling/sample.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Automatic Retries
33
summary: Shows immediate and delayed retries when a handler throws an exception.
4-
reviewed: 2023-09-15
4+
reviewed: 2025-08-04
55
component: Core
66
related:
77
- nservicebus/recoverability
@@ -13,26 +13,26 @@ This sample shows the different ways that NServiceBus [recoverability features](
1313

1414
Run the sample **without debugging**.
1515

16-
The message handler in both endpoints is set to throw an exception, causing the handled message to end up in the error queue. The portable Particular Service Platform will list the messages arriving in the error queue.
16+
The message handler in both endpoints (`WithoutDelayedRetries` and `WithDelayedRetries`) is set to throw an exception, causing the handled message to end up in the error queue. The portable Particular Service Platform will list the messages arriving in the error queue.
1717

1818
snippet: handler
1919

20-
The "With Delayed Retries" endpoint uses the standard Delayed Retries settings.
20+
The `WithDelayedRetries` endpoint uses the standard Delayed Retries settings.
2121

22-
The "Disable Delayed Retries" endpoint disables Delayed Retries with the following:
22+
The `WithoutDelayedRetries` endpoint disables Delayed Retries with the following:
2323

2424
snippet: Disable
2525

2626
## The output
2727

2828
> [!WARNING]
29-
> This sample uses `Console.Writeline` instead of standard logging only for brevity and should not be used in production code.
29+
> This sample uses `Console.WriteLine` instead of standard logging only for brevity and should not be used in production code.
3030
3131
### Without Delayed Retries
3232

3333
In this endpoint, the message is retried successively without any delay and then, after the final failure, it is forwarded to the configured error queue.
3434

35-
```
35+
```bash
3636
Handling MyMessage with MessageId:b5d0ea24-63c7-4729-8fd3-a6dc0161a7f8
3737
Handling MyMessage with MessageId:b5d0ea24-63c7-4729-8fd3-a6dc0161a7f8
3838
Handling MyMessage with MessageId:b5d0ea24-63c7-4729-8fd3-a6dc0161a7f8
@@ -45,9 +45,9 @@ System.Exception: An exception occurred in the handler.
4545

4646
### With Delayed Retries
4747

48-
In this endpoint, the message is tried successively first and then delayed for the configured amount of time and then retried again. After the final configured retry, the message is moved to the error queue. The sample displays the retry number for clarity.
48+
In this endpoint, the message is first [retried immediately](/nservicebus/recoverability/#immediate-retries), then retried again after a [configured delay](/nservicebus/recoverability/configure-delayed-retries.md). After the final configured retry, the message is moved to the error queue. The sample displays the retry number for clarity.
4949

50-
```
50+
```bash
5151
This is retry number 1
5252
Handling MyMessage with MessageId:05b97154-04b9-405a-92d7-a6dc0163273f
5353
Handling MyMessage with MessageId:05b97154-04b9-405a-92d7-a6dc0163273f

0 commit comments

Comments
 (0)