use of org.apache.flink.streaming.connectors.gcp.pubsub.BlockingGrpcPubSubSubscriber in project flink by apache.
the class PubSubSubscriberFactoryForEmulator method getSubscriber.
@Override
public PubSubSubscriber getSubscriber(Credentials credentials) throws IOException {
ManagedChannel managedChannel = NettyChannelBuilder.forTarget(hostAndPort).usePlaintext().build();
PullRequest pullRequest = PullRequest.newBuilder().setMaxMessages(maxMessagesPerPull).setSubscription(projectSubscriptionName).build();
SubscriberGrpc.SubscriberBlockingStub stub = SubscriberGrpc.newBlockingStub(managedChannel);
return new BlockingGrpcPubSubSubscriber(projectSubscriptionName, managedChannel, stub, pullRequest, retries, timeout);
}
Aggregations