You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

38 lines
1022 B

  1. using Microsoft.AspNetCore.Builder;
  2. using Microsoft.Extensions.Configuration;
  3. using Microsoft.Extensions.DependencyInjection;
  4. namespace Sample.Pulsar.InMemory
  5. {
  6. public class Startup
  7. {
  8. public Startup(IConfiguration configuration)
  9. {
  10. Configuration = configuration;
  11. }
  12. public IConfiguration Configuration { get; }
  13. public void ConfigureServices(IServiceCollection services)
  14. {
  15. string pulsarUri = Configuration.GetValue("AppSettings:PulsarUri", "pulsar//localhost:6650");
  16. services.AddCap(x =>
  17. {
  18. x.UseInMemoryStorage();
  19. x.UsePulsar(pulsarUri);
  20. x.UseDashboard();
  21. });
  22. services.AddControllers();
  23. }
  24. public void Configure(IApplicationBuilder app)
  25. {
  26. app.UseRouting();
  27. app.UseEndpoints(endpoints =>
  28. {
  29. endpoints.MapControllers();
  30. });
  31. }
  32. }
  33. }