public static IBrokeredMessageReceiver CreateBrokeredMessageReceiver(this IBusFactorySelector selector, IBinder binder, Action <IWebJobReceiverConfigurator> configure) { if (binder == null) { throw new ArgumentNullException(nameof(binder)); } if (configure == null) { throw new ArgumentNullException(nameof(configure)); } var topologyConfiguration = new ServiceBusTopologyConfiguration(AzureBusFactory.MessageTopology); var busConfiguration = new ServiceBusBusConfiguration(topologyConfiguration); ServiceBusHostConfigurator hostConfigurator = new ServiceBusHostConfigurator(new Uri("sb://no-host-configured/")); var hostConfiguration = busConfiguration.CreateHostConfiguration(hostConfigurator.Settings); var endpointConfiguration = new BrokeredMessageReceiverServiceBusEndpointConfiguration(hostConfiguration, busConfiguration); var configurator = new WebJobBrokeredMessageReceiverSpecification(binder, endpointConfiguration); configure(configurator); return(configurator.Build()); }
public static IEventDataReceiver CreateEventDataReceiver(this IBusFactorySelector selector, IBinder binder, Action <IWebJobReceiverConfigurator> configure) { if (binder == null) { throw new ArgumentNullException(nameof(binder)); } if (configure == null) { throw new ArgumentNullException(nameof(configure)); } var topologyConfiguration = new ServiceBusTopologyConfiguration(AzureBusFactory.MessageTopology); var busConfiguration = new ServiceBusBusConfiguration(topologyConfiguration); var endpointConfiguration = new BrokeredMessageReceiverServiceBusEndpointConfiguration(busConfiguration); var configurator = new WebJobEventDataReceiverSpecification(binder, endpointConfiguration); configure(configurator); return(configurator.Build()); }