Class BlockingGrpcPubSubSubscriber
- java.lang.Object
-
- org.apache.flink.streaming.connectors.gcp.pubsub.BlockingGrpcPubSubSubscriber
-
- All Implemented Interfaces:
Acknowledger<String>,PubSubSubscriber
public class BlockingGrpcPubSubSubscriber extends Object implements PubSubSubscriber
Implementation forPubSubSubscriber. This Grpc PubSubSubscriber allows for flexible timeouts and retries.
-
-
Constructor Summary
Constructors Constructor Description BlockingGrpcPubSubSubscriber(String projectSubscriptionName, io.grpc.ManagedChannel channel, com.google.pubsub.v1.SubscriberGrpc.SubscriberBlockingStub stub, com.google.pubsub.v1.PullRequest pullRequest, int retries, java.time.Duration timeout)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacknowledge(List<String> acknowledgementIds)voidclose()After returning all resources should have been cleaned up.List<com.google.pubsub.v1.ReceivedMessage>pull()
-
-
-
Constructor Detail
-
BlockingGrpcPubSubSubscriber
public BlockingGrpcPubSubSubscriber(String projectSubscriptionName, io.grpc.ManagedChannel channel, com.google.pubsub.v1.SubscriberGrpc.SubscriberBlockingStub stub, com.google.pubsub.v1.PullRequest pullRequest, int retries, java.time.Duration timeout)
-
-
Method Detail
-
pull
public List<com.google.pubsub.v1.ReceivedMessage> pull()
- Specified by:
pullin interfacePubSubSubscriber
-
acknowledge
public void acknowledge(List<String> acknowledgementIds)
- Specified by:
acknowledgein interfaceAcknowledger<String>
-
close
public void close() throws ExceptionDescription copied from interface:PubSubSubscriberAfter returning all resources should have been cleaned up.- Specified by:
closein interfacePubSubSubscriber- Throws:
Exception
-
-