Interface ConsumerAwareRecordInterceptor<K,V>
- Type Parameters:
K- the key type.V- the value type.
- All Superinterfaces:
RecordInterceptor<K,,V> ThreadStateProcessor
- All Known Implementing Classes:
CompositeRecordInterceptor
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface ConsumerAwareRecordInterceptor<K,V>
extends RecordInterceptor<K,V>
A
RecordInterceptor that has access to the Consumer.- Since:
- 2.7
-
Method Summary
Methods inherited from interface org.springframework.kafka.listener.RecordInterceptor
afterRecord, failure, successMethods inherited from interface org.springframework.kafka.listener.ThreadStateProcessor
clearThreadState, setupThreadState
-
Method Details
-
intercept
@Nullable default org.apache.kafka.clients.consumer.ConsumerRecord<K,V> intercept(org.apache.kafka.clients.consumer.ConsumerRecord<K, V> record) Description copied from interface:RecordInterceptorPerform some action on the record or return a different one. If null is returned the record will be skipped. Invoked before the listener.- Specified by:
interceptin interfaceRecordInterceptor<K,V> - Parameters:
record- the record.- Returns:
- the record or null.
-
intercept
@Nullable org.apache.kafka.clients.consumer.ConsumerRecord<K,V> intercept(org.apache.kafka.clients.consumer.ConsumerRecord<K, V> record, org.apache.kafka.clients.consumer.Consumer<K, V> consumer) Description copied from interface:RecordInterceptorPerform some action on the record or return a different one. If null is returned the record will be skipped. Invoked before the listener.- Specified by:
interceptin interfaceRecordInterceptor<K,V> - Parameters:
record- the record.consumer- the consumer.- Returns:
- the record or null.
-