/// <summary> /// Declare a ReceiveEndpoint using a unique generated queue name. This queue defaults to auto-delete /// and non-durable. By default all services bus instances include a default receiveEndpoint that is /// of this type (created automatically upon the first receiver binding). /// </summary> /// <param name="configurator"></param> /// <param name="host"></param> /// <param name="configure"></param> public static void ReceiveEndpoint(this IServiceBusBusFactoryConfigurator configurator, IServiceBusHost host, Action <IServiceBusReceiveEndpointConfigurator> configure) { var queueName = configurator.GetTemporaryQueueName("endpoint"); configurator.ReceiveEndpoint(host, queueName, x => { x.AutoDeleteOnIdle = TimeSpan.FromMinutes(5); x.EnableExpress = true; configure(x); }); }
/// <summary> /// Configures a Turnout on the receive endpoint, which executes a long-running job and supervises the job until it /// completes. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="configurator">The receive endpoint configurator</param> /// <param name="busFactoryConfigurator">The bus factory configuration to use a separate endpoint for the control traffic</param> /// <param name="configure"></param> public static void Turnout <T>(this IServiceBusReceiveEndpointConfigurator configurator, IServiceBusBusFactoryConfigurator busFactoryConfigurator, Action <ITurnoutHostConfigurator <T> > configure) where T : class { var temporaryQueueName = busFactoryConfigurator.GetTemporaryQueueName("turnout-"); busFactoryConfigurator.ReceiveEndpoint(configurator.Host, temporaryQueueName, turnoutEndpointConfigurator => { turnoutEndpointConfigurator.AutoDeleteOnIdle = TimeSpan.FromMinutes(5); turnoutEndpointConfigurator.EnableExpress = true; configurator.ConfigureTurnoutEndpoints(busFactoryConfigurator, turnoutEndpointConfigurator, configure); }); }