Created
January 30, 2019 21:40
-
-
Save phatboyg/2f7ae5dd92c60682c24104acb7693bb4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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