Beispiel #1
0
 public override int WriteToWire(KafkaWireWriter writer)
 {
     writer.Write((short)ApiKey);
     writer.Write(ApiVersion);
     writer.Write(CorrelationId);
     return 2 + 2 + 4 + writer.WriteAndReturnLength(ClientId);
 }
 public override int WriteToWire(KafkaWireWriter writer)
 {
     var baseBytes = base.WriteToWire(writer);
     writer.Write(RequiredAcks);
     writer.Write(Timeout);
     var productinsBytes = writer.Write(TopicProductions);
     return baseBytes + 2 + 4 + productinsBytes;
 }
Beispiel #3
0
 public override int WriteToWire(KafkaWireWriter writer)
 {
     var baseBytes = base.WriteToWire(writer);
     writer.Write(ReplicaId);
     writer.Write(MaxWaitTime);
     writer.Write(MinBytes);
     return baseBytes + 4 + 4 + 4 + writer.Write(Topics);
 }
Beispiel #4
0
 public byte[] BytesForWire()
 {
     using (var ms = new MemoryStream())
     using (var w = new KafkaWireWriter(ms))
     {
         w.Write(0);
         var bytesWritten = WriteToWire(w);
         w.Seek(0, SeekOrigin.Begin);
         w.Write(bytesWritten);
         return ms.ToArray();
     }
 }
Beispiel #5
0
        public Message(int crc, byte magicByte, byte attributes, byte[] key, byte[] value)
        {
            Crc = crc;
            MagicByte = magicByte;
            Attributes = attributes;
            Key = key;
            Value = value;

            _MessageData = new byte[4 + 1 + 1 + 4 + (key == null ? 0 : key.Length) + 4 + (value == null ? 0 : value.Length)];
            using (var ms = new MemoryStream(_MessageData))
            using (var w = new KafkaWireWriter(ms))
            {
                w.Write(Crc);
                w.Write(MagicByte);
                w.Write(Attributes);
                w.Write(Key);
                w.Write(Value);
            }
        }
 public override int WriteToWire(KafkaWireWriter writer)
 {
     writer.Write(Partition);
     writer.Write(MessageSetSize);
     return 4 + 4 + writer.WriteWithoutSize(MessageSet);
 }
 public override int WriteToWire(KafkaWireWriter writer)
 {
     return writer.WriteAndReturnLength(Topic) + writer.Write(Partitions);
 }
Beispiel #8
0
 public override int WriteToWire(KafkaWireWriter writer)
 {
     writer.Write(Partition);
     writer.Write(FetchOffset);
     writer.Write(MaxBytes);
     return 4 + 8 + 4;
 }
Beispiel #9
0
 public override int WriteToWire(KafkaWireWriter writer)
 {
     var baseBytes = base.WriteToWire(writer);
     return baseBytes + writer.Write(TopicNames);
 }
Beispiel #10
0
 public abstract int WriteToWire(KafkaWireWriter writer);
Beispiel #11
0
 public override int WriteToWire(KafkaWireWriter writer)
 {
     writer.WriteWithoutSize(_MessageData);
     return _MessageData.Length;
 }