Version 15.5 introduces the new queue type (D)elay. Delay processing is a workflow where specific messages being dequeued cannot yet be processed, and should be retried later. However, other messages within the queue can be processed and should not be blocked.
Delay processing only applies to out-of-order message processing.
For example, let’s assume you need to send messages to an external service. This external service returns a 425 (too early) response code if the message cannot yet be handled and should be retried later. Other messages within the queue can be successfully processed and should not be blocked by those that cannot.
Your device (or Connexion custom code devices) can use the following pattern to delay the processing of a specific message:
public override async Task ProcessMessageAsync(IMessageContext context, CancellationToken token) { // attempt to send message to a service var response = await service.Submit(context.message); if(response.NotReady) // service indicates the message cannot be processed yet // Call the ReprocessMessage method passing in a timespan for when we should retry context.ReprocessMessage(TimeSpan.FromMinutes(5)); }