Skip to content

Commit

Permalink
apply review.
Browse files Browse the repository at this point in the history
  • Loading branch information
chickenchickenlove committed Apr 23, 2024
1 parent 22483e8 commit 99f5430
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -703,14 +703,12 @@ private void resolveFilter(MethodKafkaListenerEndpoint<?, ?> endpoint, KafkaList
Object filter = resolveExpression(kafkaListener.filter());
if (filter instanceof RecordFilterStrategy rfs) {
endpoint.setRecordFilterStrategy(rfs);
endpoint.setAckDiscarded(true);
}
else {
String filterBeanName = resolveExpressionAsString(kafkaListener.filter(), "filter");
if (StringUtils.hasText(filterBeanName)) {
endpoint.setRecordFilterStrategy(
this.beanFactory.getBean(filterBeanName, RecordFilterStrategy.class));
endpoint.setAckDiscarded(true);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ public void setReplyTemplate(KafkaTemplate<?, ?> replyTemplate) {
@SuppressWarnings("unchecked")
public void setRecordFilterStrategy(RecordFilterStrategy<? super K, ? super V> recordFilterStrategy) {
this.recordFilterStrategy = (RecordFilterStrategy<K, V>) recordFilterStrategy;
setAckDiscarded(true);
}

protected boolean isAckDiscarded() {
Expand Down

0 comments on commit 99f5430

Please sign in to comment.