Gateway.SendAllAysnc doesn't execute request validator

hi,

I have an issue with Service.Gateway.SendAllAsync.

we import via a KafkaConsumer a message, which contains multiple datasets, where we have already existing Import request imlpementations.
The current implementation is like this:

public async Task PostAsync(kafkaImportRequest request)
{
     await Gateway.SendAllAsync(request.ConvertTo<List<InternalRequest>>()); // for the convertion exists a RequestConverter, which is registered via the AutoMapping
}

public async Task PostAsync(InternalRequest request)
{
      // do some stuff
}

for the Internal Request exists a Request Validator to make sure not import invalid data (AbstractValidator).

the problem is now, that forwarding the request using Gateway.SendAllAsync doesn’t execute the existing request Validator. The request will be forwarded to PostAsync(InternalRequest request) without that, which results in importing invalid data.

our current workaround is, to run over the list using an foreach and use Gateway.SendAsync(…) , which validates the request.

My question is, is there another way to forward the requests in one call with validation?

The latest v8.0.1+ that’s now available in the Pre Release Packages should now invoke the Validators for each individual Request DTO in batched SendAll/SendAllAsync requests.

And how is it handled then, is there then the WebServiceException exceptions somehow converted into a respose object or is it throwing when validation failes?

It is throwing a WebServiceException when validation fails.

ok, so that means, I have 10 Requests, and the 5th is invalid.
Then the first 4 are processed and the 6-10 are not processed anymore because 5 throws an exception?

(sorry, i tried to find the implementation of SendAll to answer my question itself, but I not found it :wink: )

The Validators are run for all requests, only if they were all succeeded would it execute the batched request.