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); } }
public ConsumerService(IOptions <SubscriberConfig> subscriberConfig, IOptions <AppConfig> appConfig) { this.subscriberConfig = subscriberConfig.Value; this.appConfig = appConfig.Value; }
public AMQPSession(AppConfig appConfig, SubscriberConfig subscriberConfig, bool autoRecovery = true) { this.appConfig = appConfig; this.subscriberConfig = subscriberConfig; InitSession(); }
public static AMQPSession Instance(AppConfig appConfig, SubscriberConfig subscriberConfig) { return(new AMQPSession(appConfig, subscriberConfig)); }