Yolean / kubernetes-kafka

Kafka cluster as Kubernetes StatefulSet, plain manifests and config
Apache License 2.0
1.83k stars 738 forks source link

Spring kafka not validating the payload #313

Closed sanurani2020 closed 4 years ago

sanurani2020 commented 4 years ago

I've tried both @Valid and @Validated. I've tried adding a MethodValidationPostProcessor bean. I've tried adding a Validator to the KafkaListenerEndpointRegistrar (as per the EnableKafka javadoc):

But no matter what I try, I can still pass invalid requests in and they process without error. Any help will be appreciated. @KafkaListener( topics = "${spring.tradeweb.kafka.topic}") public void onMessage(@Valid @Payload List> records) { logger.info("received TradewebMessage='{}'", records.size()); List messageList = new ArrayList<>();

Using Spring boot 2.0.5 and kafka 2.1.10

solsson commented 4 years ago

Seems unrelated to this repository. Any indication that what you're trying to do works with other Kafka setups but not with this one?

sanurani2020 commented 4 years ago

My apologies for posting here , was preparing to post in kafak dev community.