Which release / version are you looking at ? In trunk branch, I only see one toSend():
protected Send toSend(String destination, ResponseHeader header, short apiVersion) { return new NetworkSend(destination, serialize(apiVersion, header)); On Fri, Sep 29, 2017 at 4:49 PM, Javed, Haseeb <javed...@buckeyemail.osu.edu > wrote: > The Kafka protocol guide mentions that each request and response contains > a correlationId which is a user-supplied integer to match requests and > corresponding responses. However, when I look at the code in the class > AbstractResponse, we have a method defined as following: > > > public Send toSend(String destination, RequestHeader requestHeader) { > return toSend(destination, requestHeader.apiVersion(), requestHeader. > toResponseHeader()); > } > > So basically we are just using the requestHeader to generate the > responseHeader so doesn't this pretty much guarantees that the > correlationId for the Request and the Response would always be the same, or > am I missing something? > > >