Class AbstractPulsarProducerProcessor<T>
java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processors.pulsar.AbstractPulsarProducerProcessor<T>
- All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent,org.apache.nifi.processor.Processor
- Direct Known Subclasses:
PublishPulsar,PublishPulsarRecord
public abstract class AbstractPulsarProducerProcessor<T>
extends org.apache.nifi.processor.AbstractProcessor
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate final class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.nifi.components.PropertyDescriptorprotected List<AbstractPulsarProducerProcessor<T>.AsyncPublisher>static final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorprotected AtomicBooleanstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptor(package private) static final org.apache.nifi.components.AllowableValue(package private) static final org.apache.nifi.components.AllowableValue(package private) static final org.apache.nifi.components.AllowableValueprotected BlockingQueue<MessageTuple<T>>static final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptor(package private) static final org.apache.nifi.components.AllowableValue(package private) static final org.apache.nifi.components.AllowableValue(package private) static final org.apache.nifi.components.AllowableValuestatic final Stringstatic final org.apache.nifi.components.PropertyDescriptorprivate PulsarConsumerLRUCache<String,org.apache.pulsar.client.api.Producer<T>> protected static final List<org.apache.nifi.components.PropertyDescriptor>private ExecutorServicestatic final org.apache.nifi.components.PropertyDescriptorprivate PulsarClientServicestatic final org.apache.nifi.processor.Relationshipstatic final org.apache.nifi.processor.Relationshipprotected static final Set<org.apache.nifi.processor.Relationship>static final org.apache.nifi.components.PropertyDescriptorstatic final Stringprotected AtomicBooleanprotected BlockingQueue<MessageTuple<T>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanUp(org.apache.nifi.processor.ProcessContext context) private List<AbstractPulsarProducerProcessor<T>.AsyncPublisher>private org.apache.pulsar.client.api.ProducerBuilder<T>getBuilder(org.apache.nifi.processor.ProcessContext context, String topic) getMappedMessageProperties(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile ff) protected StringgetMessageKey(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile ff) protected org.apache.pulsar.client.api.Producer<T>getProducer(org.apache.nifi.processor.ProcessContext context, String topic) protected PulsarConsumerLRUCache<String,org.apache.pulsar.client.api.Producer<T>> protected ExecutorServiceprotected PulsarClientServiceSet<org.apache.nifi.processor.Relationship>protected List<org.apache.nifi.components.PropertyDescriptor>protected voidhandleFailures(org.apache.nifi.processor.ProcessSession session) If the processor is configured to run in asynchronous mode, then we need to periodically check the failureList and route those records to the FAILURE relationship, so that the end user is aware of the failures and can handle them as they see fit.voidinit(org.apache.nifi.processor.ProcessContext context) protected org.apache.pulsar.client.api.MessageIdsend(org.apache.pulsar.client.api.Producer<T> producer, String key, Map<String, String> properties, T value) private voidprotected voidsetProducers(PulsarConsumerLRUCache<String, org.apache.pulsar.client.api.Producer<T>> producers) protected voidsetPublisherPool(ExecutorService publisherPool) protected voidsetPulsarClientService(PulsarClientService pulsarClientService) voidshutDown(org.apache.nifi.processor.ProcessContext context) Methods inherited from class org.apache.nifi.processor.AbstractProcessor
onTrigger, 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
-
MSG_COUNT
- See Also:
-
TOPIC_NAME
- See Also:
-
COMPRESSION_TYPE_NONE
static final org.apache.nifi.components.AllowableValue COMPRESSION_TYPE_NONE -
COMPRESSION_TYPE_LZ4
static final org.apache.nifi.components.AllowableValue COMPRESSION_TYPE_LZ4 -
COMPRESSION_TYPE_ZLIB
static final org.apache.nifi.components.AllowableValue COMPRESSION_TYPE_ZLIB -
MESSAGE_ROUTING_MODE_CUSTOM_PARTITION
static final org.apache.nifi.components.AllowableValue MESSAGE_ROUTING_MODE_CUSTOM_PARTITION -
MESSAGE_ROUTING_MODE_ROUND_ROBIN_PARTITION
static final org.apache.nifi.components.AllowableValue MESSAGE_ROUTING_MODE_ROUND_ROBIN_PARTITION -
MESSAGE_ROUTING_MODE_SINGLE_PARTITION
static final org.apache.nifi.components.AllowableValue MESSAGE_ROUTING_MODE_SINGLE_PARTITION -
REL_SUCCESS
public static final org.apache.nifi.processor.Relationship REL_SUCCESS -
REL_FAILURE
public static final org.apache.nifi.processor.Relationship REL_FAILURE -
PULSAR_CLIENT_SERVICE
public static final org.apache.nifi.components.PropertyDescriptor PULSAR_CLIENT_SERVICE -
TOPIC
public static final org.apache.nifi.components.PropertyDescriptor TOPIC -
ASYNC_ENABLED
public static final org.apache.nifi.components.PropertyDescriptor ASYNC_ENABLED -
MAX_ASYNC_REQUESTS
public static final org.apache.nifi.components.PropertyDescriptor MAX_ASYNC_REQUESTS -
AUTO_UPDATE_PARTITIONS
public static final org.apache.nifi.components.PropertyDescriptor AUTO_UPDATE_PARTITIONS -
AUTO_UPDATE_PARTITION_INTERVAL
public static final org.apache.nifi.components.PropertyDescriptor AUTO_UPDATE_PARTITION_INTERVAL -
BATCHING_ENABLED
public static final org.apache.nifi.components.PropertyDescriptor BATCHING_ENABLED -
BATCHING_MAX_BYTES
public static final org.apache.nifi.components.PropertyDescriptor BATCHING_MAX_BYTES -
BATCHING_MAX_MESSAGES
public static final org.apache.nifi.components.PropertyDescriptor BATCHING_MAX_MESSAGES -
BATCH_INTERVAL
public static final org.apache.nifi.components.PropertyDescriptor BATCH_INTERVAL -
BLOCK_IF_QUEUE_FULL
public static final org.apache.nifi.components.PropertyDescriptor BLOCK_IF_QUEUE_FULL -
COMPRESSION_TYPE
public static final org.apache.nifi.components.PropertyDescriptor COMPRESSION_TYPE -
CHUNKING_ENABLED
public static final org.apache.nifi.components.PropertyDescriptor CHUNKING_ENABLED -
CHUNK_MAX_MESSAGE_SIZE
public static final org.apache.nifi.components.PropertyDescriptor CHUNK_MAX_MESSAGE_SIZE -
MESSAGE_DEMARCATOR
public static final org.apache.nifi.components.PropertyDescriptor MESSAGE_DEMARCATOR -
MESSAGE_ROUTING_MODE
public static final org.apache.nifi.components.PropertyDescriptor MESSAGE_ROUTING_MODE -
PENDING_MAX_MESSAGES
public static final org.apache.nifi.components.PropertyDescriptor PENDING_MAX_MESSAGES -
MAPPED_MESSAGE_PROPERTIES
public static final org.apache.nifi.components.PropertyDescriptor MAPPED_MESSAGE_PROPERTIES -
MESSAGE_KEY
public static final org.apache.nifi.components.PropertyDescriptor MESSAGE_KEY -
PROPERTIES
-
RELATIONSHIPS
-
pulsarClientService
-
producers
-
publisherPool
-
canPublish
-
trackFailures
-
workQueue
-
failureQueue
-
asyncPublishers
-
-
Constructor Details
-
AbstractPulsarProducerProcessor
public AbstractPulsarProducerProcessor()
-
-
Method Details
-
getRelationships
- Specified by:
getRelationshipsin interfaceorg.apache.nifi.processor.Processor- Overrides:
getRelationshipsin classorg.apache.nifi.processor.AbstractSessionFactoryProcessor
-
getSupportedPropertyDescriptors
- Overrides:
getSupportedPropertyDescriptorsin classorg.apache.nifi.components.AbstractConfigurableComponent
-
init
@OnScheduled public void init(org.apache.nifi.processor.ProcessContext context) -
shutDown
@OnUnscheduled public void shutDown(org.apache.nifi.processor.ProcessContext context) -
cleanUp
@OnStopped public void cleanUp(org.apache.nifi.processor.ProcessContext context) -
handleFailures
protected void handleFailures(org.apache.nifi.processor.ProcessSession session) If the processor is configured to run in asynchronous mode, then we need to periodically check the failureList and route those records to the FAILURE relationship, so that the end user is aware of the failures and can handle them as they see fit.- Parameters:
session- - The current processor session
-
getAsyncPublishers
-
setAsyncPublishers
-
getProducer
-
getBuilder
-
getPulsarClientService
-
setPulsarClientService
-
getProducers
-
setProducers
protected void setProducers(PulsarConsumerLRUCache<String, org.apache.pulsar.client.api.Producer<T>> producers) -
getPublisherPool
-
setPublisherPool
-
getMessageKey
protected String getMessageKey(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile ff) -
getMappedMessageProperties
-
send
protected org.apache.pulsar.client.api.MessageId send(org.apache.pulsar.client.api.Producer<T> producer, String key, Map<String, String> properties, T value) throws org.apache.pulsar.client.api.PulsarClientException- Throws:
org.apache.pulsar.client.api.PulsarClientException
-