Reputation: 24518
I'm looking for the following timeout options on the client side. In other words, how do you set an upper limit on these times?
There's a deadline documented, but it's not clear to me which of the above three corresponds to it.
I've seen this and this post, but none of them answer my question.
Upvotes: 2
Views: 26854
Reputation: 878
I am a bit confused about the question. Question is about setting timeout options, and the bullet points are about metrics. My answer is based on the question. assuming #1 is how to set connection timeout, you can configure it via NettyChannelBuilder
.
In NettyChannelBuilder
(most common), you can pass channel options via NettyChannelBuilder#withOption. You can check known channel options in netty ChannelOption.
ManagedChannel channel = NettyChannelBuilder
.forTarget(target)
// For other channel options see linked javadoc above
.withOption(ChannelOption.CONNECT_TIMEOUT_MILLIS, (int) TimeUnit.SECONDS.toMillis(5))
.build();
#2 and #3 needs more clarifications, but sounds like it is related to deadline.
Upvotes: 2