public int Parse(byte[] data, int offset ) { var dataOffset = offset; int eaten = 0; dataOffset = BufferReader.Read(data, dataOffset, out messageOffset); dataOffset = BufferReader.Read(data, dataOffset, out messageSize); message = Message.ParseFrom(data.Skip(dataOffset).ToArray()); // Return used byte count return messageSize + dataOffset - offset; }
/// <summary> /// Sends a message to Kafka. /// </summary> /// <param name="topic">The topic to publish to.</param> /// <param name="partition">The partition to publish to.</param> /// <param name="msg">The message to send.</param> public void Send(string topic, int partition, Message msg) { Send(topic, partition, new List<Message> { msg }); }
public Message SetMessage(byte[] payLoad) { message = new Message(payLoad); return message; }
public MessageSet(byte[] payLoad) { message = new Message(payLoad); }