public static class SampleScenarios.KafkaExactlyOnce extends Object
ConsumerConfig.ISOLATION_LEVEL_CONFIG
read_committed will consume exactly one copy of each message from the
destination topic after the messages are committed by the sender. Offsets for the
source partitions are committed using the transactional sender to ensure that even
if exceptions are encountered, the flow restarts from the last committed state.| Modifier and Type | Field and Description |
|---|---|
protected String |
destTopic |
protected String |
sourceTopic |
| Constructor and Description |
|---|
KafkaExactlyOnce(String bootstrapServers,
String sourceTopic,
String destTopic) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
String |
email(SampleScenarios.Person p) |
Flux<?> |
flux() |
reactor.kafka.receiver.ReceiverOptions<Integer,SampleScenarios.Person> |
receiverOptions() |
reactor.kafka.receiver.ReceiverOptions<Integer,SampleScenarios.Person> |
receiverOptions(Collection<String> topics) |
void |
runScenario() |
reactor.kafka.sender.KafkaSender<Integer,SampleScenarios.Person> |
sender(reactor.kafka.sender.SenderOptions<Integer,SampleScenarios.Person> senderOptions) |
reactor.kafka.sender.SenderOptions<Integer,SampleScenarios.Person> |
senderOptions() |
reactor.kafka.samples.SampleScenarios.CommittableSource |
source() |
void |
source(reactor.kafka.samples.SampleScenarios.CommittableSource source) |
ProducerRecord<Integer,SampleScenarios.Person> |
transform(SampleScenarios.Person p) |
protected final String sourceTopic
protected final String destTopic
public reactor.kafka.sender.SenderOptions<Integer,SampleScenarios.Person> senderOptions()
public reactor.kafka.receiver.ReceiverOptions<Integer,SampleScenarios.Person> receiverOptions()
public ProducerRecord<Integer,SampleScenarios.Person> transform(SampleScenarios.Person p)
public String email(SampleScenarios.Person p)
public Flux<?> flux()
public void runScenario()
throws InterruptedException
InterruptedExceptionpublic void close()
public reactor.kafka.sender.KafkaSender<Integer,SampleScenarios.Person> sender(reactor.kafka.sender.SenderOptions<Integer,SampleScenarios.Person> senderOptions)
public reactor.kafka.receiver.ReceiverOptions<Integer,SampleScenarios.Person> receiverOptions(Collection<String> topics)
public void source(reactor.kafka.samples.SampleScenarios.CommittableSource source)
public reactor.kafka.samples.SampleScenarios.CommittableSource source()