public class PublisherLease extends Object implements Closeable
| Modifier and Type | Field and Description |
|---|---|
private boolean |
activeTransaction |
private Pattern |
attributeNameRegex |
private Charset |
headerCharacterSet |
private ComponentLog |
logger |
private long |
maxAckWaitMillis |
private int |
maxMessageSize |
private AtomicLong |
messagesSent |
private boolean |
poisoned |
private org.apache.kafka.clients.producer.Producer<byte[],byte[]> |
producer |
private InFlightMessageTracker |
tracker |
private boolean |
transactionsInitialized |
private boolean |
useTransactions |
| Constructor and Description |
|---|
PublisherLease(org.apache.kafka.clients.producer.Producer<byte[],byte[]> producer,
int maxMessageSize,
long maxAckWaitMillis,
ComponentLog logger,
boolean useTransactions,
Pattern attributeNameRegex,
Charset headerCharacterSet) |
| Modifier and Type | Method and Description |
|---|---|
private void |
addHeaders(FlowFile flowFile,
Map<String,String> additionalAttributes,
org.apache.kafka.clients.producer.ProducerRecord<?,?> record) |
(package private) void |
beginTransaction() |
void |
close() |
PublishResult |
complete() |
(package private) void |
fail(FlowFile flowFile,
Exception cause) |
InFlightMessageTracker |
getTracker() |
boolean |
isPoisoned() |
protected void |
poison() |
protected void |
publish(FlowFile flowFile,
byte[] messageKey,
byte[] messageContent,
String topic,
InFlightMessageTracker tracker,
Integer partition) |
(package private) void |
publish(FlowFile flowFile,
InputStream flowFileContent,
byte[] messageKey,
byte[] demarcatorBytes,
String topic,
Integer partition) |
protected void |
publish(FlowFile flowFile,
Map<String,String> additionalAttributes,
byte[] messageKey,
byte[] messageContent,
String topic,
InFlightMessageTracker tracker,
Integer partition) |
(package private) void |
publish(FlowFile flowFile,
RecordSet recordSet,
RecordSetWriterFactory writerFactory,
RecordSchema schema,
String messageKeyField,
String topic,
Function<Record,Integer> partitioner) |
(package private) void |
rollback() |
private final ComponentLog logger
private final org.apache.kafka.clients.producer.Producer<byte[],byte[]> producer
private final int maxMessageSize
private final long maxAckWaitMillis
private final boolean useTransactions
private final Pattern attributeNameRegex
private final Charset headerCharacterSet
private volatile boolean poisoned
private final AtomicLong messagesSent
private volatile boolean transactionsInitialized
private volatile boolean activeTransaction
private InFlightMessageTracker tracker
public PublisherLease(org.apache.kafka.clients.producer.Producer<byte[],byte[]> producer,
int maxMessageSize,
long maxAckWaitMillis,
ComponentLog logger,
boolean useTransactions,
Pattern attributeNameRegex,
Charset headerCharacterSet)
protected void poison()
public boolean isPoisoned()
void beginTransaction()
void rollback()
void publish(FlowFile flowFile, InputStream flowFileContent, byte[] messageKey, byte[] demarcatorBytes, String topic, Integer partition) throws IOException
IOExceptionvoid publish(FlowFile flowFile, RecordSet recordSet, RecordSetWriterFactory writerFactory, RecordSchema schema, String messageKeyField, String topic, Function<Record,Integer> partitioner) throws IOException
IOExceptionprivate void addHeaders(FlowFile flowFile, Map<String,String> additionalAttributes, org.apache.kafka.clients.producer.ProducerRecord<?,?> record)
protected void publish(FlowFile flowFile, byte[] messageKey, byte[] messageContent, String topic, InFlightMessageTracker tracker, Integer partition)
protected void publish(FlowFile flowFile, Map<String,String> additionalAttributes, byte[] messageKey, byte[] messageContent, String topic, InFlightMessageTracker tracker, Integer partition)
public PublishResult complete()
public void close()
close in interface Closeableclose in interface AutoCloseablepublic InFlightMessageTracker getTracker()
Copyright © 2022 Apache NiFi Project. All rights reserved.