GCP PubSub Subscriber Agent
Subscribers are registered listeners on a subscription that receives messages. Subscribers interact with the PubSub service to read messages from pull subscriptions.
To receive messages that a topic publishes, you must create a subscription for that topic. Only messages that the topic publishes after you create the subscription are available to subscriber applications. When the service sends a message to a subscriber, the subscriber must acknowledge the message. Without acknowledgment, the message remains outstanding, and PubSub repeatedly attempts to redeliver it to the same subscriber. These messages are not delivered to other subscribers within the same subscription.
The GCP PubSub subscriber agent is available as a collection agent in real-time workflows.
Pull mechanism
The agent receives messages using Pub/Sub's StreamingPull API (RPC StreamingPullRequest) over a persistent gRPC stream. For details, refer to Google's official Pub/Sub documentation.
Note!
To acknowledge a collected message, you must follow these steps:
Route the same PubSubUDR back to the collector agent.
Ensure that you do not create and route a different-but-identical copy of the UDR.
Confirm that the agent can use the original UDR to find its associated consumer and acknowledge the message.
The agent tracks the original UDR association with its consumer. If you route back a different-but-identical UDR, the message is not acknowledged. In that case, the agent throws a NullPointerException because getConsumer() returns null, which means that the UDR is not tied to any producer, and you cannot use it to acknowledge the message.
This section has the following subsections: