public static AppendRequest ReadFromStream(BinaryStream buffer) { var request = new AppendRequest(); request.Topic = buffer.Reader.ReadString(); request.Partition = buffer.Reader.ReadInt32(); request.Messages = new MessageReader(buffer).ReadAllMessages().ToList(); return request; }
public static AppendRequest ReadFromStream(BinaryStream buffer) { var request = new AppendRequest(); request.Topic = buffer.Reader.ReadString(); request.Partition = buffer.Reader.ReadInt32(); request.Messages = new MessageReader(buffer).ReadAllMessages().ToList(); return(request); }
/// <summary> /// Send binary message to specified topic with specified key, using specified partitioner. /// </summary> public void Send(String topic, byte[] payload, Object key, IPartitioner partitioner) { var partitionsNumber = GetNumberOfPartitionsForTopic(topic); var partition = _partitioner.SelectPartition(null, partitionsNumber); var request = new AppendRequest(topic, partition, Message.CreateMessage(payload)); _pushSender.Push(request); }