in flink-connector-gcp-pubsub/src/main/java/org/apache/flink/streaming/connectors/gcp/pubsub/emulator/PubSubSubscriberFactoryForEmulator.java [61:75]
public PubSubSubscriber getSubscriber(Credentials credentials) throws IOException {
ManagedChannel managedChannel =
NettyChannelBuilder.forTarget(hostAndPort)
.usePlaintext() // This is 'Ok' because this is ONLY used for testing.
.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);
}