コード例 #1
0
        public EventHubMessageBus(MessageBusSettings settings, EventHubMessageBusSettings eventHubSettings)
            : base(settings)
        {
            EventHubSettings = eventHubSettings;

            _producersByTopic.ValueFactory = topic =>
            {
                Log.DebugFormat("Creating EventHubClient for path {0}", topic);
                return(EventHubSettings.EventHubClientFactory(topic));
            };

            Log.Info("Creating consumers");
            foreach (var consumerSettings in settings.Consumers)
            {
                Log.InfoFormat("Creating consumer for Topic: {0}, Group: {1}, MessageType: {2}", consumerSettings.Topic, consumerSettings.Group, consumerSettings.MessageType);
                //var consumer = new EventHubConsumer(this, group, messageType, subscribersByMessageType.ToList());
                _consumers.Add(new EventHubConsumer(this, consumerSettings));
            }

            if (settings.RequestResponse != null)
            {
                Log.InfoFormat("Creating response consumer for Topic: {0}, Group: {1}", settings.RequestResponse.Topic, settings.RequestResponse.Group);
                // _consumers.Add(new EvenHubResponseConsumer(this, settings.RequestResponse));
                _consumers.Add(new EventHubConsumer(this, settings.RequestResponse));
            }
        }
コード例 #2
0
        public EventHubMessageBus(MessageBusSettings settings, EventHubMessageBusSettings eventHubSettings)
            : base(settings)
        {
            ProviderSettings = eventHubSettings;

            OnBuildProvider();
        }
コード例 #3
0
        public EventHubMessageBus(MessageBusSettings settings, EventHubMessageBusSettings eventHubSettings)
            : base(settings)
        {
            _logger          = LoggerFactory.CreateLogger <EventHubMessageBus>();
            ProviderSettings = eventHubSettings;

            OnBuildProvider();
        }
コード例 #4
0
        public EventHubMessageBus(MessageBusSettings settings, EventHubMessageBusSettings eventHubSettings)
            : base(settings)
        {
            EventHubSettings = eventHubSettings;

            _producerByTopic = new SafeDictionaryWrapper <string, EventHubClient>(topic =>
            {
                Log.DebugFormat("Creating EventHubClient for path {0}", topic);
                return(EventHubSettings.EventHubClientFactory(topic));
            });

            Log.Info("Creating consumers");
            foreach (var consumerSettings in settings.Consumers)
            {
                Log.InfoFormat("Creating consumer for Topic: {0}, Group: {1}, MessageType: {2}", consumerSettings.Topic, consumerSettings.Group, consumerSettings.MessageType);
                _consumers.Add(new GroupTopicConsumer(this, consumerSettings));
            }

            if (settings.RequestResponse != null)
            {
                Log.InfoFormat("Creating response consumer for Topic: {0}, Group: {1}", settings.RequestResponse.Topic, settings.RequestResponse.Group);
                _consumers.Add(new GroupTopicConsumer(this, settings.RequestResponse));
            }
        }
コード例 #5
0
 public static MessageBusBuilder WithProviderEventHub(this MessageBusBuilder mbb, EventHubMessageBusSettings eventHubSettings)
 {
     return(mbb.WithProvider(settings => new EventHubMessageBus(settings, eventHubSettings)));
 }