Class GcpClientCall<ReqT,RespT> (1.11.0)
public class GcpClientCall<ReqT,RespT> extends ClientCall<ReqT,RespT>
A wrapper of ClientCall that can fetch the affinitykey from the request/response message.
It stores the information such as method, calloptions, the ChannelRef which created it, etc to
facilitate creating new calls. It gets the affinitykey from the request/response message, and
defines the callback functions to manage the number of active streams and bind/unbind the
affinity key with the channel.
Inherited Members
io.grpc.ClientCall.cancel(java.lang.String,java.lang.Throwable)
io.grpc.ClientCall.getAttributes()
io.grpc.ClientCall.halfClose()
io.grpc.ClientCall.isReady()
io.grpc.ClientCall.request(int)
io.grpc.ClientCall.sendMessage(ReqT)
io.grpc.ClientCall.setMessageCompression(boolean)
io.grpc.ClientCall.start(io.grpc.ClientCall.Listener<RespT>,io.grpc.Metadata)
Type Parameters |
| Name |
Description |
ReqT |
|
RespT |
|
Constructors
GcpClientCall(GcpManagedChannel delegateChannel, MethodDescriptor<ReqT,RespT> methodDescriptor, CallOptions callOptions, AffinityConfig affinity)
protected GcpClientCall(GcpManagedChannel delegateChannel, MethodDescriptor<ReqT,RespT> methodDescriptor, CallOptions callOptions, AffinityConfig affinity)
| Parameters |
| Name |
Description |
delegateChannel |
GcpManagedChannel
|
methodDescriptor |
io.grpc.MethodDescriptor<ReqT,RespT>
|
callOptions |
io.grpc.CallOptions
|
affinity |
AffinityConfig
|
Methods
cancel(String message, Throwable cause)
public void cancel(String message, Throwable cause)
Overrides
io.grpc.ClientCall.cancel(java.lang.String,java.lang.Throwable)
getAttributes()
public Attributes getAttributes()
May only be called after Listener#onHeaders or Listener#onClose.
| Returns |
| Type |
Description |
io.grpc.Attributes |
|
Overrides
io.grpc.ClientCall.getAttributes()
halfClose()
Overrides
io.grpc.ClientCall.halfClose()
isReady()
Calls that send exactly one message should not check this method.
Overrides
io.grpc.ClientCall.isReady()
request(int numMessages)
public void request(int numMessages)
| Parameter |
| Name |
Description |
numMessages |
int
|
Overrides
io.grpc.ClientCall.request(int)
sendMessage(ReqT message)
public void sendMessage(ReqT message)
Delay executing operations until call.sendMessage() is called, switch the channel, start the
call, do previous operations, and finally do sendMessage().
| Parameter |
| Name |
Description |
message |
ReqT
|
Overrides
io.grpc.ClientCall.sendMessage(ReqT)
setMessageCompression(boolean enabled)
public void setMessageCompression(boolean enabled)
| Parameter |
| Name |
Description |
enabled |
boolean
|
Overrides
io.grpc.ClientCall.setMessageCompression(boolean)
public void start(ClientCall.Listener<RespT> responseListener, Metadata headers)
| Parameters |
| Name |
Description |
responseListener |
io.grpc.ClientCall.Listener<RespT>
|
headers |
io.grpc.Metadata
|
Overrides
io.grpc.ClientCall.start(io.grpc.ClientCall.Listener<RespT>,io.grpc.Metadata)
toString()
| Returns |
| Type |
Description |
String |
|
Overrides
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-06-19 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-06-19 UTC."],[],[]]