API to service insight to retry a failed message

I work in a support department supporting all the applications at my work. I would like to know if we have any api call documentation to service insight so that I can check all the failed messages based on message type and time window and retry them. our application is on various servers and i would like to loop through the server building the application server service insight url and calling an api to retry the failed messages on that server. This will reduce our manual effort of submitting each message on each server for retrying once we fix an underlying issue. Looking for .net API call documentation

Hi @jagmanu,

There are a couple options for you:

The most automated option would be for you to subscribe to the events that ServiceControl publishes whenever it ingests a failed message. You can use these events to record and categorize the messages so that you know which ones to retry based on date and message type.

Another option is to make the same HTTP GETs and POSTs that ServicePulse does. To get all the failed messages for a specific message type it would be something similar to:

GET http://servicecontrol:port/api/recoverability/groups/Message%20Type?classifierFilter=<MESSAGETYPEGOESHERE>

That will return a JSON object with all the messages for that message type. It does not allow filtering by date, so the first option of subscribing to the ServiceControl events is probably a better choice as you can then categorize the messages as you need.

Once you have the message IDs, you can retry them by submitting a POST to:

http://servicecontrol:port/api/errors/retry and encoding an array of the message IDs as the POST body.

Dear,

It does not work with the messageID, it looks like you need to pass the ServiceControl.Retry.UniqueMessageId. Any idea on how to get that from the failed Message object?

The events from the Contracts package provides the FailedMessageId which is the one that you need to provide to the ServiceControl HTTP API.