예제 #1
0
        public void Run()
        {
            Log.Information("Running dotnet mirror with current setup | sourceBrokerList {source} | destinationBrokerList {destination} | topics {topics} | consumerGroup {consumerGroup}",
                            _config.SourceBrokerList, _config.DestinationBrokerList, _config.SourceTopics, _config.ConsumerGroup);

            _useReplicaTopics = string.IsNullOrEmpty(_config.DestinationTopic);
            if (!_useReplicaTopics)
            {
                Log.Information("Messages will be aggregated to destination topic {topic}", _config.DestinationTopic);
            }

            while (!_disposing)
            {
                var message = _kafkaConsumer.GetMessage();
                if (message != null)
                {
                    MirrorMessage(message);
                }
            }
        }