in extension/WebJobs.Extensions.RabbitMQ.Samples/Program.cs [14:50]
public static async Task Main()
{
// Add or remove types from this list to choose which functions will
// be indexed by the JobHost.
// To run some of the other samples included, add their types to this list
var typeLocator = new SamplesTypeLocator(
typeof(RabbitMQSamples));
IHostBuilder builder = new HostBuilder()
.UseEnvironment("Development")
.ConfigureWebJobs(webJobsBuilder =>
{
webJobsBuilder
.AddAzureStorageCoreServices()
.AddAzureStorageQueues()
.AddRabbitMQ()
.AddTimers();
})
.ConfigureLogging(b =>
{
b.SetMinimumLevel(LogLevel.Debug);
b.AddConsole();
})
.ConfigureServices(s =>
{
s.AddSingleton<ITypeLocator>(typeLocator);
})
.UseConsoleLifetime();
IHost host = builder.Build();
using (host)
{
var jobHost = (JobHost)host.Services.GetService<IJobHost>();
await host.RunAsync();
}
}