You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by chw <ch...@gmx.de> on 2018/05/21 08:56:00 UTC

Unclear client-to-broker communication

Hi everybody,

the communication between the client and the broker is unclear to me.
The documentation states:

> The client initiates a socket connection and then writes a sequence of
> request messages and reads back the corresponding response message. No
> handshake is required on connection or disconnection.

Does the client hold the TCP connection for its whole livecycle? That
is, the client connects once to the broker and keeps the connection for
all subsequent requests/messages (as opposed to a HTTP request)?

As I know, the TCP requires a 3-way handshake to establish a connection.
However, the documentation states that no handskake is required. Could
anybody explain that point in more detail?

> TCP is happier if you maintain persistent connections used for many
> requests to amortize the cost of the TCP handshake, but beyond this
> penalty connecting is pretty cheap.
I do not understand what the purpose of this sentence is. On the one
hand, TCP is explained a little. On the other hand, a justification
concerning performance is made. But: none of this information helps the
user. Should I, as user, ensure that a connection is maintained
persistently or does Kafka do that for me?

It would be great, if someone could update the documentation accordingly.

Regards,
Christian



Re: Unclear client-to-broker communication

Posted by chw <ch...@gmx.de>.
Could anyone please help?


Am 21.05.2018 um 10:56 schrieb chw:
> Hi everybody,
>
> the communication between the client and the broker is unclear to me.
> The documentation states:
>
>> The client initiates a socket connection and then writes a sequence of
>> request messages and reads back the corresponding response message. No
>> handshake is required on connection or disconnection.
> Does the client hold the TCP connection for its whole livecycle? That
> is, the client connects once to the broker and keeps the connection for
> all subsequent requests/messages (as opposed to a HTTP request)?
>
> As I know, the TCP requires a 3-way handshake to establish a connection.
> However, the documentation states that no handskake is required. Could
> anybody explain that point in more detail?
>
>> TCP is happier if you maintain persistent connections used for many
>> requests to amortize the cost of the TCP handshake, but beyond this
>> penalty connecting is pretty cheap.
> I do not understand what the purpose of this sentence is. On the one
> hand, TCP is explained a little. On the other hand, a justification
> concerning performance is made. But: none of this information helps the
> user. Should I, as user, ensure that a connection is maintained
> persistently or does Kafka do that for me?
>
> It would be great, if someone could update the documentation accordingly.
>
> Regards,
> Christian
>
>