user2812323
user2812323

Reputation: 33

NServiceBus ServiceInsight - Post Retry

I am trying to create a web page that contains a link that will attempt to retry an a message.

Below is a stubbed out (R&D - it is ugly, forgive me) call that attempts to retry a specific message. First is my url correct? I grabbed the guid from ServiceInsight and when I right click it in ServiceInsight it has the option to retry it. When I execute this code is comes back as successful and there is no payload, but when I refresh ServiceInsight the message is still there.

Any insight you can provide would be greatly appreciated. On a side note, it would be nice to get a return value of some nature. For example, what if the message is already processed successfully, in which case the retry should ack something back saying it can't be done. For example, if I right click an item in ServiceInsight that has a green icon in the status column, the retry option is not enabled.

function DoPost(){
alert("start");

jQuery.support.cors = true;

$.post( "http://localhost:33333/api/errors/97db46a9-dd22-488d-8ec3-a24770bbxdcf/retry", 
    function(data) { alert(data); alert( "success" );})  
    .done(function() { alert( "done" );  })  
    .fail(function(xhr, ajaxOptions, thrownError) { alert(xhr.status); alert(thrownError); alert( "error" );  })  
    .always(function() { alert( "always" ); }   );

alert("end");

}

Upvotes: 0

Views: 240

Answers (1)

Hadi Eskandari
Hadi Eskandari

Reputation: 26354

ServiceInsight only allows retrying messages that are failed at this stage. Later we'll add sending messages (also in bulk) for things like load testing. The reason the retry option is disabled on messages with green icon is that.

The retry process is asynchronous by nature, you fire a request and it returns immediately. Later, when the message is actually processed, it may work so that message is processed successfully, or it may fail again, which might end up having (probably the same) error again. The reason you don't get a return value from retry is that we don't know at that stage if it is processed or not. While your request if not yet processed, if you get a list of messages, that particular message waiting to be retried would have RetryIssued status.

It turns out Service Control (a.k.a Management API) does not check if the message can or can not be retried, it just checks if the provided message Id exists.

Upvotes: 1

Related Questions