我正在使用 Spring Integration 接收 http 消息,然后将其放入通道并进行一些转换。
我阅读了文档(https://docs.spring.io/spring-integration/reference/html/http.html),它看起来像:
@Bean
public HttpRequestHandlingMessagingGateway inbound() {
HttpRequestHandlingMessagingGateway gateway =
new HttpRequestHandlingMessagingGateway(true);
gateway.setRequestMapping(mapping());
gateway.setRequestPayloadType(SomeBean.class);
gateway.setRequestChannelName("httpRequest");
return gateway;
}
我想使用 JSR 303 bean 验证 ( https://beanvalidation.org/1.0/spec/ ) 来验证有效负载,这可能吗?什么是最好的方法?
提前致谢!