Thursday, 29 August 2019

kafka message filter.

record -> (record.value() == null) || (record.value().getPayload() == null) || (record.value().getFriend().getSex() == null) || !record.value(). getFriend(). getSex().startsWith("g"));

you can use this to filter message,  when it return "true" the message will be ignored..... which means your listener will not receive it.

Note:  this filter will receive it and the message is deserialised to your java mode object.

No comments:

Post a comment