Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagec#
    public override void OnError(IMessageContext context, Connexion.Core.ErrorEventArgs args)
    {
      if(args.Exception is NotSupportedException)
      {
        args.ShouldRetry = true;
        args.SleepTime = TimeSpan.FromMinutes(2);
        Logger.Write(EventSeverity.Error, 54321, args.Exception.Message);
      }
    }

Using the implementation above, messages will not be moved to the error queue. They will remain in the queued state and errors will be logged to your device.

Image Added

Next, implement your batch processing method. It is important to note that the error handling behavior within batch processing differs from the regular ProcessMessageAsync method.

  1. You must provide your own exception handling and individually set the properties of each context within the batch. For example, if you are sending messages to an external service in parallel, you must handle updating each individual context manually.