Example usage for org.springframework.kafka.core KafkaTemplate isTransactional

List of usage examples for org.springframework.kafka.core KafkaTemplate isTransactional

Introduction

In this page you can find the example usage for org.springframework.kafka.core KafkaTemplate isTransactional.

Prototype

@Override
    public boolean isTransactional() 

Source Link

Usage

From source file:org.springframework.kafka.listener.DeadLetterPublishingRecoverer.java

/**
 * Create an instance with the provided template and destination resolving function,
 * that receives the failed consumer record and the exception and returns a
 * {@link TopicPartition}. If the partition in the {@link TopicPartition} is less than 0, no
 * partition is set when publishing to the topic.
 * @param template the {@link KafkaTemplate} to use for publishing.
 * @param destinationResolver the resolving function.
 *///from   www . j a v a2 s.c o  m
public DeadLetterPublishingRecoverer(KafkaTemplate<Object, Object> template,
        BiFunction<ConsumerRecord<?, ?>, Exception, TopicPartition> destinationResolver) {

    Assert.notNull(template, "The template cannot be null");
    Assert.notNull(destinationResolver, "The destinationResolver cannot be null");
    this.template = template;
    this.transactional = template.isTransactional();
    this.destinationResolver = destinationResolver;
}