K - the key type.V - the value type.public class DefaultBatchToRecordAdapter<K,V> extends java.lang.Object implements BatchToRecordAdapter<K,V>
BatchToRecordAdapter implementation; if the supplied recoverer
throws an exception, the batch will be aborted; otherwise the next record will be
processed.BatchToRecordAdapter.Callback<K,V>| Constructor and Description |
|---|
DefaultBatchToRecordAdapter()
Construct an instance with the default recoverer which simply logs the failed
record.
|
DefaultBatchToRecordAdapter(ConsumerRecordRecoverer recoverer)
Construct an instance with the provided recoverer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
adapt(java.util.List<org.springframework.messaging.Message<?>> messages,
java.util.List<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>> records,
Acknowledgment ack,
org.apache.kafka.clients.consumer.Consumer<?,?> consumer,
BatchToRecordAdapter.Callback<K,V> callback)
Adapt the list and invoke the callback for each message.
|
public DefaultBatchToRecordAdapter()
public DefaultBatchToRecordAdapter(ConsumerRecordRecoverer recoverer)
recoverer - the recoverer.public void adapt(java.util.List<org.springframework.messaging.Message<?>> messages,
java.util.List<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>> records,
Acknowledgment ack,
org.apache.kafka.clients.consumer.Consumer<?,?> consumer,
BatchToRecordAdapter.Callback<K,V> callback)
BatchToRecordAdapteradapt in interface BatchToRecordAdapter<K,V>messages - the messages.records - the records.ack - the acknowledgment.consumer - the consumer.callback - the callback.