Skip to content

Commit

Permalink
Merge pull request #33 from momentohq/topics-resilience
Browse files Browse the repository at this point in the history
chore: add a keep alive timeout for the topics channel
  • Loading branch information
nand4011 authored Jan 3, 2024
2 parents 74e46c4 + 05c41c2 commit 235adc3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ internal class TopicGrpcStubsManager(credentialProvider: CredentialProvider) : C
val channelBuilder = ManagedChannelBuilder.forAddress(credentialProvider.cacheEndpoint, 443)
channelBuilder.useTransportSecurity()
channelBuilder.disableRetry()
channelBuilder.keepAliveTime(10, TimeUnit.SECONDS)
channelBuilder.keepAliveTimeout(5, TimeUnit.SECONDS)
channelBuilder.keepAliveWithoutCalls(true)
val clientInterceptors: MutableList<ClientInterceptor> = ArrayList()
clientInterceptors.add(UserHeaderInterceptor(credentialProvider.apiKey))
channelBuilder.intercept(clientInterceptors)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ internal class TopicGrpcStubsManager(credentialProvider: CredentialProvider) : C
val channelBuilder = ManagedChannelBuilder.forAddress(credentialProvider.cacheEndpoint, 443)
channelBuilder.useTransportSecurity()
channelBuilder.disableRetry()
channelBuilder.keepAliveTime(10, TimeUnit.SECONDS)
channelBuilder.keepAliveTimeout(5, TimeUnit.SECONDS)
channelBuilder.keepAliveWithoutCalls(true)
val clientInterceptors: MutableList<ClientInterceptor> = ArrayList()
clientInterceptors.add(UserHeaderInterceptor(credentialProvider.apiKey))
channelBuilder.intercept(clientInterceptors)
Expand Down

0 comments on commit 235adc3

Please sign in to comment.