ConsumeGCPubSub 2025.10.9.21

Bundle

org.apache.nifi | nifi-gcp-nar

Description

Consumes messages from the configured Google Cloud PubSub subscription. The ‘Batch Size’ property specified the maximum number of messages that will be pulled from the subscription in a single request. The ‘Processing Strategy’ property specifies if each message should be its own FlowFile or if messages should be grouped into a single FlowFile. Using the Demarcator strategy will provide best throughput when the format allows it. Using Record allows to convert data format as well as doing schema enforcement. Using the FlowFile strategy will generate one FlowFile per message and will have the message’s attributes as FlowFile attributes.

Tags

consume, gcp, google, google-cloud, message, pubsub

Input Requirement

FORBIDDEN

Supports Sensitive Dynamic Properties

false

Properties

PropertyDescription
GCP Credentials Provider ServiceThe Controller Service used to obtain Google Cloud Platform credentials.
Message DemarcatorSince the PubSub client receives messages in batches, this Processor has an option to output FlowFiles which contains all the messages in a single batch. This property allows you to provide a string (interpreted as UTF-8) to use for demarcating apart multiple messages. To enter special character such as ‘new line’ use CTRL+Enter or Shift+Enter depending on the OS.
Output StrategyThe format used to output the Kafka Record into a FlowFile Record.
Processing StrategyStrategy for processing PubSub Records and writing serialized output to FlowFiles
Record ReaderThe Record Reader to use for incoming messages
Record WriterThe Record Writer to use in order to serialize the outgoing FlowFiles
api-endpointOverride the gRPC endpoint in the form of [host:port]
gcp-project-idGoogle Cloud Project ID
gcp-pubsub-publish-batch-sizeIndicates the number of messages the cloud service should bundle together in a batch. If not set and left empty, only one message will be used in a batch
gcp-pubsub-subscriptionName of the Google Cloud Pub/Sub Subscription
proxy-configuration-serviceSpecifies the Proxy Configuration Controller Service to proxy network requests.

Relationships

NameDescription
successFlowFiles are routed to this relationship after a successful Google Cloud Pub/Sub operation.

Writes attributes

NameDescription
gcp.pubsub.ackIdAcknowledgement Id of the consumed Google Cloud PubSub message
gcp.pubsub.messageSizeSerialized size of the consumed Google Cloud PubSub message
gcp.pubsub.attributesCountNumber of attributes the consumed PubSub message has, if any
gcp.pubsub.publishTimeTimestamp value when the message was published
gcp.pubsub.subscriptionName of the PubSub subscription
Dynamic AttributesOther than the listed attributes, this processor may write zero or more attributes, if the original Google Cloud Publisher client added any attributes to the message while sending

See also