Exemple #1
0
 public static PullMessageRequest ReadFromStream(Stream stream)
 {
     using (var reader = new BinaryReader(stream))
     {
         var request = new PullMessageRequest();
         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.PullMessageBatchSize           = reader.ReadInt32();
         request.SuspendPullRequestMilliseconds = reader.ReadInt64();
         request.ConsumeFromWhere               = (ConsumeFromWhere)reader.ReadInt32();
         return(request);
     }
 }
 public static void WriteToStream(PullMessageRequest request, Stream stream)
 {
     using (var writer = new BinaryWriter(stream))
     {
         writer.Write(request.ConsumerId);
         writer.Write(request.ConsumerGroup);
         writer.Write(request.MessageQueue.BrokerName);
         writer.Write(request.MessageQueue.Topic);
         writer.Write(request.MessageQueue.QueueId);
         writer.Write(request.Tags);
         writer.Write(request.QueueOffset);
         writer.Write(request.PullMessageBatchSize);
         writer.Write(request.SuspendPullRequestMilliseconds);
         writer.Write((int)request.ConsumeFromWhere);
     }
 }
Exemple #3
0
 public static void WriteToStream(PullMessageRequest request, Stream stream)
 {
     using (var writer = new BinaryWriter(stream))
     {
         writer.Write(request.ConsumerId);
         writer.Write(request.ConsumerGroup);
         writer.Write(request.MessageQueue.BrokerName);
         writer.Write(request.MessageQueue.Topic);
         writer.Write(request.MessageQueue.QueueId);
         writer.Write(request.Tags);
         writer.Write(request.QueueOffset);
         writer.Write(request.PullMessageBatchSize);
         writer.Write(request.SuspendPullRequestMilliseconds);
         writer.Write((int)request.ConsumeFromWhere);
     }
 }
 public static PullMessageRequest ReadFromStream(Stream stream)
 {
     using (var reader = new BinaryReader(stream))
     {
         var request = new PullMessageRequest();
         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.PullMessageBatchSize = reader.ReadInt32();
         request.SuspendPullRequestMilliseconds = reader.ReadInt64();
         request.ConsumeFromWhere = (ConsumeFromWhere)reader.ReadInt32();
         return request;
     }
 }