Class PublishPulsarRecord
java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processors.pulsar.AbstractPulsarProducerProcessor<byte[]>
org.apache.nifi.processors.pulsar.pubsub.PublishPulsarRecord
- All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent,org.apache.nifi.processor.Processor
@Tags({"Apache","Pulsar","Record","csv","json","avro","logs","Put","Send","Message","PubSub","1.0"})
@CapabilityDescription("Sends the contents of a FlowFile as individual records to Apache Pulsar using the Pulsar 1.x client API. The contents of the FlowFile are expected to be record-oriented data that can be read by the configured Record Reader. The complementary NiFi processor for fetching messages is ConsumePulsarRecord.")
@InputRequirement(INPUT_REQUIRED)
@WritesAttribute(attribute="msg.count",
description="The number of messages that were sent to Pulsar for this FlowFile. This attribute is added only to FlowFiles that are routed to success.")
@SeeAlso({PublishPulsar.class,ConsumePulsar.class,ConsumePulsarRecord.class})
@TriggerWhenEmpty
public class PublishPulsarRecord
extends AbstractPulsarProducerProcessor<byte[]>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final List<org.apache.nifi.components.PropertyDescriptor>static final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorFields inherited from class org.apache.nifi.processors.pulsar.AbstractPulsarProducerProcessor
ASYNC_ENABLED, asyncPublishers, AUTO_UPDATE_PARTITION_INTERVAL, AUTO_UPDATE_PARTITIONS, BATCH_INTERVAL, BATCHING_ENABLED, BATCHING_MAX_BYTES, BATCHING_MAX_MESSAGES, BLOCK_IF_QUEUE_FULL, canPublish, CHUNK_MAX_MESSAGE_SIZE, CHUNKING_ENABLED, COMPRESSION_TYPE, failureQueue, MAPPED_MESSAGE_PROPERTIES, MAX_ASYNC_REQUESTS, MESSAGE_DEMARCATOR, MESSAGE_KEY, MESSAGE_ROUTING_MODE, MSG_COUNT, PENDING_MAX_MESSAGES, PULSAR_CLIENT_SERVICE, REL_FAILURE, REL_SUCCESS, RELATIONSHIPS, TOPIC, TOPIC_NAME, trackFailures, workQueue -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<org.apache.nifi.components.PropertyDescriptor>voidonTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) private intsend(org.apache.pulsar.client.api.Producer<byte[]> producer, org.apache.nifi.serialization.RecordSetWriterFactory writerFactory, org.apache.nifi.serialization.record.RecordSchema schema, org.apache.nifi.serialization.RecordReader reader, String topic, String key, Map<String, String> properties, boolean asyncFlag) Methods inherited from class org.apache.nifi.processors.pulsar.AbstractPulsarProducerProcessor
cleanUp, getMappedMessageProperties, getMessageKey, getProducer, getProducers, getPublisherPool, getPulsarClientService, getRelationships, handleFailures, init, send, setProducers, setPublisherPool, setPulsarClientService, shutDownMethods inherited from class org.apache.nifi.processor.AbstractProcessor
onTriggerMethods inherited from class org.apache.nifi.processor.AbstractSessionFactoryProcessor
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueMethods inherited from class org.apache.nifi.components.AbstractConfigurableComponent
customValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.nifi.components.ConfigurableComponent
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validateMethods inherited from interface org.apache.nifi.processor.Processor
isStateful
-
Field Details
-
RECORD_READER
public static final org.apache.nifi.components.PropertyDescriptor RECORD_READER -
RECORD_WRITER
public static final org.apache.nifi.components.PropertyDescriptor RECORD_WRITER -
PROPERTIES
-
-
Constructor Details
-
PublishPulsarRecord
public PublishPulsarRecord()
-
-
Method Details
-
getSupportedPropertyDescriptors
- Overrides:
getSupportedPropertyDescriptorsin classAbstractPulsarProducerProcessor<byte[]>
-
onTrigger
public void onTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) throws org.apache.nifi.processor.exception.ProcessException - Specified by:
onTriggerin classorg.apache.nifi.processor.AbstractProcessor- Throws:
org.apache.nifi.processor.exception.ProcessException
-
send
private int send(org.apache.pulsar.client.api.Producer<byte[]> producer, org.apache.nifi.serialization.RecordSetWriterFactory writerFactory, org.apache.nifi.serialization.record.RecordSchema schema, org.apache.nifi.serialization.RecordReader reader, String topic, String key, Map<String, String> properties, boolean asyncFlag) throws IOException, org.apache.nifi.schema.access.SchemaNotFoundException, InterruptedException- Throws:
IOExceptionorg.apache.nifi.schema.access.SchemaNotFoundExceptionInterruptedException
-