Class PublishPulsar
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.PublishPulsar
- All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent,org.apache.nifi.processor.Processor
@SeeAlso({ConsumePulsar.class,ConsumePulsarRecord.class,PublishPulsarRecord.class})
@Tags({"Apache","Pulsar","Put","Send","Message","PubSub"})
@CapabilityDescription("Sends the contents of a FlowFile as a message to Apache Pulsar using the Pulsar Producer API.The messages to send may be individual FlowFiles or may be delimited, using a user-specified delimiter, such as a new-line. The complementary NiFi processor for fetching messages is ConsumePulsar.")
@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 This attribute is added only to FlowFiles that are routed to success.")
@TriggerWhenEmpty
public class PublishPulsar
extends AbstractPulsarProducerProcessor<byte[]>
-
Field Summary
Fields 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, PROPERTIES, PULSAR_CLIENT_SERVICE, REL_FAILURE, REL_SUCCESS, RELATIONSHIPS, TOPIC, TOPIC_NAME, trackFailures, workQueue -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) private voidsend(org.apache.pulsar.client.api.Producer<byte[]> producer, org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session, org.apache.nifi.flowfile.FlowFile flowFile, byte[] demarcatorBytes) Sends the FlowFile content using the demarcator.Methods inherited from class org.apache.nifi.processors.pulsar.AbstractPulsarProducerProcessor
cleanUp, getMappedMessageProperties, getMessageKey, getProducer, getProducers, getPublisherPool, getPulsarClientService, getRelationships, getSupportedPropertyDescriptors, 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
-
Constructor Details
-
PublishPulsar
public PublishPulsar()
-
-
Method Details
-
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 void send(org.apache.pulsar.client.api.Producer<byte[]> producer, org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session, org.apache.nifi.flowfile.FlowFile flowFile, byte[] demarcatorBytes) throws org.apache.pulsar.client.api.PulsarClientException Sends the FlowFile content using the demarcator.- Parameters:
producer-context- - The current ProcessContextsession- - The current ProcessSession.flowFile-demarcatorBytes- - The value used to identify unique records in the list- Throws:
org.apache.pulsar.client.api.PulsarClientException
-