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.
 
 
 

36 lines
1008 B

  1. using Microsoft.AspNetCore.Builder;
  2. using Microsoft.Extensions.DependencyInjection;
  3. namespace Sample.Kafka.MySql
  4. {
  5. public class Startup
  6. {
  7. public void ConfigureServices(IServiceCollection services)
  8. {
  9. services.AddCap(x =>
  10. {
  11. x.UseMySql("Server=192.168.10.110;Database=testcap;UserId=root;Password=123123;");
  12. x.UseKafka("192.168.10.110:9092");
  13. x.UseDashboard();
  14. //x.UseDiscovery(d =>
  15. //{
  16. // d.DiscoveryServerHostName = "localhost";
  17. // d.DiscoveryServerPort = 8500;
  18. // d.CurrentNodeHostName = "localhost";
  19. // d.CurrentNodePort = 5820;
  20. // d.NodeName = "CAP 2号节点";
  21. //});
  22. });
  23. services.AddMvc();
  24. }
  25. public void Configure(IApplicationBuilder app)
  26. {
  27. app.UseMvc();
  28. app.UseCap();
  29. }
  30. }
  31. }