Example #1
1
        private void SetHandlers(Confluent.Kafka.ConsumerBuilder <TKey, TValue> builder)
        {
            if (_options.ErrorHandler != null)
            {
                builder.SetErrorHandler(_options.ErrorHandler);
            }

            if (_options.KeyDeserializer != null)
            {
                builder.SetKeyDeserializer(_options.KeyDeserializer);
            }

            if (_options.ValueDeserializer != null)
            {
                builder.SetValueDeserializer(_options.ValueDeserializer);
            }

            if (_options.LogHandler != null)
            {
                builder.SetLogHandler(_options.LogHandler);
            }

            if (_options.OffsetsCommittedHandler != null)
            {
                builder.SetOffsetsCommittedHandler(_options.OffsetsCommittedHandler);
            }

            if (_options.PartitionAssignmentHandler != null)
            {
                builder.SetPartitionsAssignedHandler(_options.PartitionAssignmentHandler);
            }

            if (_options.PartitionsRevokedHandler != null)
            {
                builder.SetPartitionsRevokedHandler(_options.PartitionsRevokedHandler);
            }

            if (_options.StatisticsHandler != null)
            {
                builder.SetStatisticsHandler(_options.StatisticsHandler);
            }
        }