Пример #1
0
        private MessageConverterConfigurer CreateConverterConfigurer(string channelName, BindingOptions bindingProperties)
        {
            var bindingServiceProperties = new BindingServiceOptions();

            bindingServiceProperties.Bindings.Add(channelName, bindingProperties);
            var applicationContext = GetBinder().ApplicationContext;

            var extractors = applicationContext.GetServices <IPartitionKeyExtractorStrategy>();
            var selectors  = applicationContext.GetServices <IPartitionSelectorStrategy>();
            var bindingServiceOptionsMonitor = new BindingServiceOptionsMonitor(bindingServiceProperties);

            MessageConverterConfigurer messageConverterConfigurer = new MessageConverterConfigurer(applicationContext, bindingServiceOptionsMonitor, new CompositeMessageConverterFactory(), extractors, selectors);

            return(messageConverterConfigurer);
        }
Пример #2
0
        private IMessageChannel CreateDynamic(string name, BindingServiceOptions options)
        {
            var channel = _bindingTargetFactory.CreateOutput(name);

            if (_newBindingCallback != null)
            {
                var producerOptions = options.GetProducerOptions(name);

                _newBindingCallback.Configure(name, channel, producerOptions, null);
                options.UpdateProducerOptions(name, producerOptions);
            }

            var binding = _bindingService.BindProducer(channel, name);

            _dynamicDestinationsBindable.AddOutputBinding(name, binding);
            return(channel);
        }
Пример #3
0
 internal BindingService(BindingServiceOptions bindingServiceOptions, IBinderFactory binderFactory)
 {
     _bindingServiceOptions = bindingServiceOptions;
     _binderFactory         = binderFactory;
 }
Пример #4
0
 internal BindingService(BindingServiceOptions bindingServiceOptions, IBinderFactory binderFactory, ILogger <BindingService> logger = null)
 {
     _bindingServiceOptions = bindingServiceOptions;
     _binderFactory         = binderFactory;
     _logger = logger;
 }