예제 #1
0
        private void InitProcessHandler(SubscriberConfig subscriberConfig)
        {
            handlerMap.Clear();
            var processMapping = subscriberConfig.Subscribers.ToDictionary(k => k.Name, v => v.Type);

            foreach (var subscriber in processMapping)
            {
                var handler = (IProcessMesssageHandler)Activator.CreateInstance(Type.GetType(subscriber.Value));
                var uname   = handler.SubscribingTopic.UniqueName;
                handler.Registered();
                handlerMap.TryAdd(uname, handler);
            }
        }
예제 #2
0
 public ConsumerService(IOptions <SubscriberConfig> subscriberConfig, IOptions <AppConfig> appConfig)
 {
     this.subscriberConfig = subscriberConfig.Value;
     this.appConfig        = appConfig.Value;
 }
예제 #3
0
 public AMQPSession(AppConfig appConfig, SubscriberConfig subscriberConfig, bool autoRecovery = true)
 {
     this.appConfig        = appConfig;
     this.subscriberConfig = subscriberConfig;
     InitSession();
 }
예제 #4
0
 public static AMQPSession Instance(AppConfig appConfig, SubscriberConfig subscriberConfig)
 {
     return(new AMQPSession(appConfig, subscriberConfig));
 }