K - the key type.V - the value type.public class FilteringMessageListenerAdapter<K,V> extends AbstractFilteringMessageListener<K,V,MessageListener<K,V>> implements AcknowledgingConsumerAwareMessageListener<K,V>
MessageListener adapter that implements filter logic
via a RecordFilterStrategy.ConsumerSeekAware.ConsumerSeekCallbackdelegate, delegateType, logger| Constructor and Description |
|---|
FilteringMessageListenerAdapter(MessageListener<K,V> delegate,
RecordFilterStrategy<K,V> recordFilterStrategy)
Create an instance with the supplied strategy and delegate listener.
|
FilteringMessageListenerAdapter(MessageListener<K,V> delegate,
RecordFilterStrategy<K,V> recordFilterStrategy,
boolean ackDiscarded)
Create an instance with the supplied strategy and delegate listener.
|
| Modifier and Type | Method and Description |
|---|---|
void |
onMessage(org.apache.kafka.clients.consumer.ConsumerRecord<K,V> data)
Invoked with data from kafka.
|
void |
onMessage(org.apache.kafka.clients.consumer.ConsumerRecord<K,V> data,
Acknowledgment acknowledgment)
Invoked with data from kafka.
|
void |
onMessage(org.apache.kafka.clients.consumer.ConsumerRecord<K,V> consumerRecord,
Acknowledgment acknowledgment,
org.apache.kafka.clients.consumer.Consumer<?,?> consumer)
Invoked with data from kafka and provides access to the
Consumer. |
void |
onMessage(org.apache.kafka.clients.consumer.ConsumerRecord<K,V> data,
org.apache.kafka.clients.consumer.Consumer<?,?> consumer)
Invoked with data from kafka and provides access to the
Consumer. |
filtergetDelegate, onIdleContainer, onPartitionsAssigned, onPartitionsRevoked, registerSeekCallbackpublic FilteringMessageListenerAdapter(MessageListener<K,V> delegate, RecordFilterStrategy<K,V> recordFilterStrategy)
delegate - the delegate.recordFilterStrategy - the filter.public FilteringMessageListenerAdapter(MessageListener<K,V> delegate, RecordFilterStrategy<K,V> recordFilterStrategy, boolean ackDiscarded)
delegate - the delegate.recordFilterStrategy - the filter.ackDiscarded - true to ack (commit offset for) discarded messages when the
listener is configured for manual acks.public void onMessage(org.apache.kafka.clients.consumer.ConsumerRecord<K,V> consumerRecord, Acknowledgment acknowledgment, org.apache.kafka.clients.consumer.Consumer<?,?> consumer)
GenericMessageListenerConsumer. The
default implementation throws UnsupportedOperationException.onMessage in interface AcknowledgingConsumerAwareMessageListener<K,V>onMessage in interface GenericMessageListener<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>>consumerRecord - the data to be processed.acknowledgment - the acknowledgment.consumer - the consumer.public void onMessage(org.apache.kafka.clients.consumer.ConsumerRecord<K,V> data)
AcknowledgingConsumerAwareMessageListeneronMessage in interface AcknowledgingConsumerAwareMessageListener<K,V>onMessage in interface GenericMessageListener<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>>data - the data to be processed.public void onMessage(org.apache.kafka.clients.consumer.ConsumerRecord<K,V> data, Acknowledgment acknowledgment)
GenericMessageListenerUnsupportedOperationException.onMessage in interface GenericMessageListener<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>>data - the data to be processed.acknowledgment - the acknowledgment.public void onMessage(org.apache.kafka.clients.consumer.ConsumerRecord<K,V> data, org.apache.kafka.clients.consumer.Consumer<?,?> consumer)
GenericMessageListenerConsumer. The
default implementation throws UnsupportedOperationException.onMessage in interface GenericMessageListener<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>>data - the data to be processed.consumer - the consumer.