public void Read(TProtocol iprot) { TField field; iprot.ReadStructBegin(); while (true) { field = iprot.ReadFieldBegin(); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 1: if (field.Type == TType.String) { this.destination = iprot.ReadString(); this.__isset.destination = true; } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 2: if (field.Type == TType.String) { this.subscription = iprot.ReadString(); this.__isset.subscription = true; } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 3: if (field.Type == TType.I32) { this.destination_type = (DestinationType)iprot.ReadI32(); this.__isset.destination_type = true; } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 4: if (field.Type == TType.Struct) { this.message = new BrokerMessage(); this.message.Read(iprot); this.__isset.message = true; } else { TProtocolUtil.Skip(iprot, field.Type); } break; default: TProtocolUtil.Skip(iprot, field.Type); break; } iprot.ReadFieldEnd(); } iprot.ReadStructEnd(); }
private static BrokerMessage getBrokerMessage(NetBrokerMessage brokerMessage) { BrokerMessage brokerMsg = new BrokerMessage(); brokerMsg.Expiration = brokerMessage.Expiration; brokerMsg.Message_id = brokerMessage.MessageId; brokerMsg.Payload = brokerMessage.Payload; brokerMsg.Timestamp = brokerMessage.Timestamp; return brokerMsg; }
private static NetBrokerMessage getBrokerMessage(BrokerMessage brokerMessage) { NetBrokerMessage netBrokerMessage = new NetBrokerMessage(brokerMessage.Payload); netBrokerMessage.Expiration = brokerMessage.Expiration; netBrokerMessage.MessageId = brokerMessage.Message_id; netBrokerMessage.Timestamp = brokerMessage.Timestamp; return netBrokerMessage; }