There is an old question how to use @Valid
annotation with spring-cloud-stream library, there is even documentation how to do it in docs but in October 6 2020 @StreamListener
approach was officially deprecated and example removed.
Old way:
@StreamListener(Processor.INPUT)
@SendTo(Processor.OUTPUT)
public VoteResult handle(@Valid Vote vote) {
return votingService.record(vote);
}
New way:
public Function<Vote, VoteResult> handle() {
return vote -> votingService.record(vote);
}
My question is, how migrate this functionality using new functional model?