protected abstract BrokerConsumerMessage DecorateBrokerMessage(BrokerConsumerMessage brokerMsg);
protected override BrokerConsumerMessage DecorateBrokerMessage(BrokerConsumerMessage brokerMsg) { brokerMsg.AckWithForwardOnly = false; return brokerMsg; }
private List<IConsumerMessage> DecodeBatches(List<TppConsumerMessageBatch> batches, Type bodyClazz, IoSession channel) { List<IConsumerMessage> msgs = new List<IConsumerMessage>(); foreach (TppConsumerMessageBatch batch in batches) { List<MessageMeta> msgMetas = batch.MessageMetas; IoBuffer batchData = batch.Data; int partition = batch.Partition; for (int j = 0; j < msgMetas.Count; j++) { BaseConsumerMessage baseMsg = MessageCodec.Decode(batch.Topic, batchData, bodyClazz); BrokerConsumerMessage brokerMsg = new BrokerConsumerMessage(baseMsg); MessageMeta messageMeta = msgMetas[j]; brokerMsg.Partition = partition; brokerMsg.Priority = messageMeta.Priority == 0 ? true : false; brokerMsg.Resend = messageMeta.Resend; brokerMsg.RetryTimesOfRetryPolicy = retryPolicy.GetRetryTimes(); brokerMsg.Channel = channel; brokerMsg.MsgSeq = messageMeta.Id; msgs.Add(DecorateBrokerMessage(brokerMsg)); } } return msgs; }