コード例 #1
0
ファイル: AppendRequest.cs プロジェクト: paralect/brod
 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;
 }
コード例 #2
0
ファイル: AppendRequest.cs プロジェクト: paralect/brod
        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);
        }
コード例 #3
0
ファイル: Producer.cs プロジェクト: paralect/brod
 /// <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);
 }