public void WriteMessage(HeartbeatRequest message, IBufferWriter <byte> output)
 {
     output.WriteString(message.GroupId);
     output.WriteInt(message.GenerationId);
     output.WriteString(message.MemberId);
     output.WriteNullableString(message.GroupInstanceId);
 }
 public void WriteMessage(SyncGroupRequest message, IBufferWriter <byte> output)
 {
     output.WriteString(message.GroupId);
     output.WriteInt(message.GenerationId);
     output.WriteString(message.MemberId);
     output.WriteNullableString(message.GroupInstanceId);
     output.WriteArray(message.Assignments, WriteAssignment);
 }
 public void WriteMessage(JoinGroupRequest message, IBufferWriter <byte> output)
 {
     output.WriteString(message.GroupId);
     output.WriteInt(message.SessionTimeout);
     output.WriteInt(message.RebalanceTimeout);
     output.WriteString(message.MemberId);
     output.WriteNullableString(message.GroupInstanceId);
     output.WriteString(message.ProtocolType);
     output.WriteArray(message.Protocols, WriteProtocol);
 }
Esempio n. 4
0
        public void WriteMessage(Message <TKey, TValue> message, IBufferWriter <byte> output)
        {
            //Produce Request(Version: 7) => transactional_id acks timeout[topic_data]
            //  transactional_id => NULLABLE_STRING
            //  acks => INT16
            //  timeout => INT32
            //  topic_data => topic[data]
            //    topic => STRING
            //    data => partition record_set
            //      partition => INT32
            //      record_set => RECORDS

            output.WriteNullableString(null);  // transactional_id => NULLABLE_STRING
            output.WriteShort(-1);             // acks => INT16
            output.WriteInt(5000);             // timeout => INT32
            output.WriteInt(1);                // ???
            output.WriteString(message.Topic); // topic => STRING

            output.WriteInt(1);                // only one message
            output.WriteInt(0);                // partitionId

            WriteRecordBatch(message, output);
        }