Skip to content

Commit 00bd8d0

Browse files
Adding documentation on MessageEditedAndRetried event (#7920)
1 parent 44c2337 commit 00bd8d0

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

samples/servicecontrol/events-subscription/ServiceControlContracts_5/EndpointsMonitor/CustomEventsHandler.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ public class CustomEventsHandler(ILogger<CustomEventsHandler> logger) :
1010
IHandleMessages<FailedMessagesArchived>,
1111
IHandleMessages<FailedMessagesUnArchived>,
1212
IHandleMessages<MessageFailureResolvedByRetry>,
13-
IHandleMessages<MessageFailureResolvedManually>
13+
IHandleMessages<MessageFailureResolvedManually>,
14+
IHandleMessages<MessageEditedAndRetried>
1415
{
1516

1617
public Task Handle(MessageFailed message, IMessageHandlerContext context)
@@ -54,6 +55,12 @@ public Task Handle(MessageFailureResolvedManually message, IMessageHandlerContex
5455
logger.LogError("Received ServiceControl 'MessageFailureResolvedManually' with ID {FailedMessageId}.", message.FailedMessageId);
5556
return Task.CompletedTask;
5657
}
58+
59+
public Task Handle(MessageEditedAndRetried message, IMessageHandlerContext context)
60+
{
61+
logger.LogError("Received ServiceControl 'MessageEditedAndRetried' with ID {FailedMessageId}.", message.FailedMessageId);
62+
return Task.CompletedTask;
63+
}
5764
}
5865

5966
#endregion

samples/servicecontrol/events-subscription/sample.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ Next, restart the `NServiceBusEndpoint` application and wait up to 30 seconds. W
5959

6060
> `Heartbeat from EndpointsMonitoring.NServiceBusEndpoint restored.`
6161
62+
### MessageEditedAndRetried event
63+
64+
The `MessageEditedAndRetried` event is emitted when the [Edit and Retry feature](/servicepulse/intro-editing-messages.md) is used on a message that failed. This can be done only from ServicePulse.
65+
66+
The event is emitted each time a new edited message is successfully created and dispatched.
6267

6368
## Code walk-through
6469

servicecontrol/contracts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ ServiceControl will also publish events related to archiving and retrying messag
8787
- `FailedMessagesUnArchived`: Event emitted for failed messages that were un-archived (restored from the archive), making them eligible for retry or further action
8888
- `MessageFailureResolvedByRetry`: Event emitted by ServiceControl for each failed message that succeeded after retrying
8989
- `MessageFailureResolvedManually`: Event emitted by ServiceControl for each failed message that was manually marked as resolved, typically via the "Resolve" or "Resolve All" actions in ServicePulse
90-
90+
- `MessageEditedAndRetried`: Event emitted by ServiceControl every time that a failed message was [edited and retried](/servicepulse/intro-editing-messages.md)
9191

9292
## Decommissioning subscribers to ServiceControl events
9393

servicepulse/intro-editing-messages.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ When retrying an edited message it is possible that the original failed message
6262
6363
As soon as a message has been dispatched for retrying the originally failing message will be marked as resolved. If the retry message subsequently fails it will appear as a new failed message in the user interface. That new failed message will be marked as having been edited and also have a link to the original message.
6464
65+
Retrying a message, regardless whether it is processed correctly or not, dispatches also a [`MessageEditedAndRetried` event](/servicecontrol/contracts.md#other-events). That event includes an ID of the original message.
66+
6567
The copy of the failed message receives a new [message ID](/nservicebus/messaging/message-identity.md). The copied message is related to the original failed message through the [`NServiceBus.CorrelationId`](/nservicebus/messaging/headers.md#messaging-interaction-headers-nservicebus-correlationid) header that is set to the ID of the original message. The copy carries also the same [`NServiceBus.ConversationId`](/nservicebus/messaging/headers.md#messaging-interaction-headers-nservicebus-conversationid) as the original.
6668
6769
## Limitations and restrictions

0 commit comments

Comments
 (0)