Skip to content

Commit 6faf7f9

Browse files
pongadgarrettjonesgoogle
authored andcommitted
pubsub: add keepalive (#2585)
If streaming pull connection is idle for a long time, a firewall/proxy might terminate the connection. The keepalive should prevent this from happening, or at least let us notice that the connection is terminated so we don't wait forever. Fixes #2506
1 parent c94c2f8 commit 6faf7f9

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1

google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/Subscriber.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,7 @@ public static final class Builder {
538538
TransportChannelProvider channelProvider =
539539
SubscriptionAdminSettings.defaultGrpcTransportProviderBuilder()
540540
.setMaxInboundMessageSize(MAX_INBOUND_MESSAGE_SIZE)
541+
.setKeepAliveTime(Duration.ofMinutes(5))
541542
.build();
542543
HeaderProvider headerProvider =
543544
SubscriptionAdminSettings.defaultApiClientHeaderProviderBuilder().build();

0 commit comments

Comments
 (0)