Skip to content

Validation module compatible with batch module #1496

Closed
@jeromevdl

Description

@jeromevdl

Is your feature request related to a problem? Please describe.

The @Validation annotation should be compatible with the batch module (SQS, Kinesis), i.e. if one message is wrong do not fail the whole batch but add the message to the partial failure list.

There should not be any (maven) dependency between the 2 modules.

Describe the solution you'd like

  • browse the list of messages and validate each one (here),
  • log a warn for each invalid message
  • remove the ones that are not good (no need to pass them to the rest of the batch processing),
  • add them to the list of failure by creating an SQSBatchResponse / StreamsEventResponse and put the messages in error in the partial error. (example)
  • then the handler is called with all the remaining messages (or directly return if no message is valid), and here the batch module will work (it wil create an SQSBatchResponse / StreamsEventResponse and potentially add partial failures).
  • finally the end of the validation will complete the response returned by the handler (batch module) with the validation failure from initial steps.

Describe alternatives you've considered

eventually put the @Validation annotation on the processRawMessage but it would be much complex to develop (much more changes) and I do not see the benefit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Coming soon

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions