Skip to content

Instantly share code, notes, and snippets.

@abdullin
Created June 16, 2011 05:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abdullin/1028754 to your computer and use it in GitHub Desktop.
Save abdullin/1028754 to your computer and use it in GitHub Desktop.
Documented version of IEnvelopeQuarantine
/// <summary>
/// Implements quarantine logic for the specific message handler. Default implementation
/// is <see cref="MemoryQuarantine"/>
/// </summary>
public interface IEnvelopeQuarantine
{
/// <summary>
/// Tries to quarantine the specified envelope. Implementation can decide whether we need to give another
/// try to process the envelope (by returning <em>False</em>) or if quarantine should accept the envelope
/// completely. Then processor will discard the queue from it's incoming queue and leave it up to the
/// quarantine to record it, push to poison etc.
/// </summary>
/// <param name="context">The envelope transport context.</param>
/// <param name="ex">The exception.</param>
/// <returns><em>True</em> if envelope should be quarantined right away (i.e. exception happened 4 times)
/// and is not excepted to be processed by the queue any more; <em>False</em> otherwise</returns>
bool TryToQuarantine(EnvelopeTransportContext context, Exception ex);
/// <summary>
/// Tries to release envelope record from the partial or full quarantine (I.e.: when message
/// has been successfully processed and quarantine can forget about it forever).
/// </summary>
/// <param name="context">The envelope transport context.</param>
void TryRelease(EnvelopeTransportContext context);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment