Is it possible to batch with IMessageService?

I have a bursting/batch use case where we need to dequeue more than one item at a time (if available). Been using ConcurrentQueue but need persistence so planning to move to RedisMQ.

Is there a way to actually dequeue directly, the single message single execution model does not scale for us. I’d rather not use the redis client directly if there’s something easier in SS MQ.

Thanks in advance.

No there isn’t, all MQ APIs are strictly per message. There’s really no workaround other than defining a Request DTO that accepts a collection of Types so that multiple request DTOs are sent in one message and your Service implementation can invoke the individual Service method itself, e.g:

public class MyBatchRequests : List<MyRequest> {}

public class MyServices : Service
{
    public object Any(MyRequest request) => ....

    public object Any(MyBatchRequests requests)
    {
        var responses = requests.Map(Any);
        return responses;
    }
}