Пример #1
0
        public void MessageReceived(ConsumeResult <TKey, TValue> result)
        {
            if (delay > 0)
            {
                // this.consumer.Pause(this.consumer.Assignment); // tentativa mal sucessidada de evitar o problema de max.pull.ms que é menor que o tempo da task
                logger.Log($"Start delay: {delay}ms ({DateTime.Now.ToString("HH:mm:ss")})");
                DelayHelper.DelayMessage(result.Timestamp.UnixTimestampMs, delay, cancellationToken);
                logger.Log($"Stop delay: {delay}ms ({DateTime.Now.ToString("HH:mm:ss")})");
                // this.consumer.Resume(this.consumer.Assignment); // tentativa mal sucessidada de evitar o problema de max.pull.ms que é menor que o tempo da task
            }

            this.consumerClient.MessageReceived(result);
        }
Пример #2
0
        public void MessageReceived(ConsumeResult <TKey, TValue> result)
        {
            if (delay > 0)
            {
                // this.consumer.Pause(this.consumer.Assignment);
                logger.Log($"Start delay: {delay}ms ({DateTime.Now.ToString("HH:mm:ss")})");
                DelayHelper.DelayMessage(result.Timestamp.UnixTimestampMs, delay, cancellationToken);
                logger.Log($"Stop delay: {delay}ms ({DateTime.Now.ToString("HH:mm:ss")})");
                // this.consumer.Resume(this.consumer.Assignment);
            }

            this.Resend(result, this.redirectTopic);
            this.consumerClient?.MessageReceived(result);
        }