Exemple #1
0
 public void Write2Stream(PullMessageRequest request)
 {
     writer.Write(request.Id);
     writer.Write(request.ConsumerId);
     writer.Write(request.ConsumerGroup);
     writer.Write(request.MessageQueue.v1);
     writer.Write(request.MessageQueue.v2);
     writer.Write(request.MessageQueue.v3);
     writer.Write(request.Tags);
     writer.Write(request.QueueOffset);
     writer.Write(request.SuspendPullRequestMilliseconds);
 }
Exemple #2
0
 public PullMessageRequest ReadFromStream()
 {
     using (var reader = new BinaryReader(stream))
     {
         var request = new PullMessageRequest();
         request.Id            = reader.ReadInt32();
         request.ConsumerId    = reader.ReadString();
         request.ConsumerGroup = reader.ReadString();
         request.MessageQueue  = new MessageQueue(reader.ReadString(), reader.ReadString(), reader.ReadInt32());
         request.Tags          = reader.ReadString();
         request.QueueOffset   = reader.ReadInt64();
         request.SuspendPullRequestMilliseconds = reader.ReadInt64();
         return(request);
     }
 }