Example #1
0
        public WorkerDestination()
        {
            try
            {
                WorkerLogger.Debug("Start Initializing ZMQ Consumer.");
                ZMQSubscriber = new ZMQSubscriber();

                Dictionary <string, List <string> > DicZMQTopic = new Dictionary <string, List <string> >();

                foreach (ZMQPublisherList item in IOHelper.AgentConfig.PublisherList)
                {
                    DicZMQTopic.Add(item.ZMQAddress, item.TopicList);
                    // WorkerLogger.Control(CommonMessages.ZMQTopicList(item.ZMQAddress, string.Join(",", item.TopicList.ToArray())));
                }
                string strError = string.Empty;
                ZMQSubscriber.InitialiseMultipleSubscriber(DicZMQTopic, out strError, 100, 1000, IOHelper.AgentConfig.ZMQSecurity);

                if (!string.IsNullOrEmpty(strError))
                {
                    WorkerLogger.Error(CommonMessages.InitializeZMQConnectionFailed(strError));
                }
                else
                {
                    WorkerLogger.Control(CommonMessages.InitializeZMQConnectionSucc);
                }

                //     LoadMappingConfig();
            }
            catch (Exception Ex0)
            {
                //WorkerLogger.Exception(Ex0);
                WorkerLogger.TraceLog(MessageType.Error, Ex0.Message);
            }
        }