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 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

      private static final List<org.apache.nifi.components.PropertyDescriptor> PROPERTIES
  • Constructor Details

    • PublishPulsarRecord

      public PublishPulsarRecord()
  • Method Details

    • getSupportedPropertyDescriptors

      protected List<org.apache.nifi.components.PropertyDescriptor> getSupportedPropertyDescriptors()
      Overrides:
      getSupportedPropertyDescriptors in class AbstractPulsarProducerProcessor<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:
      onTrigger in class org.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:
      IOException
      org.apache.nifi.schema.access.SchemaNotFoundException
      InterruptedException