Skip to content

Instantly share code, notes, and snippets.

@phatboyg
Created January 30, 2019 21:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phatboyg/2f7ae5dd92c60682c24104acb7693bb4 to your computer and use it in GitHub Desktop.
Save phatboyg/2f7ae5dd92c60682c24104acb7693bb4 to your computer and use it in GitHub Desktop.
public class Startup
{
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseMvc();
}
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
services.AddMassTransit(cfg =>
{
cfg.AddConsumer<ValueConsumer>();
cfg.AddBus(provider => Bus.Factory.CreateUsingInMemory(x =>
{
x.UseExtensionsLogging(provider.GetService<ILoggerFactory>());
x.ReceiveEndpoint("value", e =>
{
e.ConfigureConsumer<ValueConsumer>(provider);
EndpointConvention.Map<AddValue>(e.InputAddress);
});
}));
cfg.AddRequestClient<AddValue>();
});
services.AddSingleton<IHostedService, BusService>();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment