private void Run()
        {
            {
                // Note: All event handlers are called on the main thread.
                consumer.OnMessage += (_, msg) =>
                {
                    var @event = JsonConvert.DeserializeObject <KafkaEventStream>(msg.Value);
                    dispatcher?.DispatchMessage(@event);
                };

                consumer.OnError += (_, error)
                                    => dispatcher?.WriteErrorLog(error.Reason);

                consumer.OnPartitionsAssigned += (_, partitions) =>
                {
                    consumer.Assign(partitions);
                };

                consumer.OnPartitionsRevoked += (_, partitions) =>
                {
                    consumer.Unassign();
                };

                /*consumer.OnStatistics += (_, json)
                 *  => Console.WriteLine($"Statistics: {json}");*/

                consumer.Subscribe(topics);

                //Console.WriteLine($"Subscribed to: [{string.Join(", ", consumer.Subscription)}]");

                /*var cancelled = false;
                 * Console.CancelKeyPress += (_, e) =>
                 * {
                 *  e.Cancel = true; // prevent the process from terminating.
                 *  cancelled = true;
                 * };*/

                try
                {
                    while (running)
                    {
                        consumer?.Poll(TimeSpan.FromMilliseconds(1000));
                    }

                    consumer?.Dispose();
                }
                catch (Exception)
                {
                }
            }
        }