您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

12345678910111213141516171819202122232425262728293031323334353637
  1. using System;
  2. using DotNetCore.CAP.Internal;
  3. using Microsoft.Extensions.DependencyInjection;
  4. using Microsoft.Extensions.Logging;
  5. namespace Sample.ConsoleApp
  6. {
  7. public class Program
  8. {
  9. public static void Main(string[] args)
  10. {
  11. var container = new ServiceCollection();
  12. container.AddLogging(x => x.AddConsole());
  13. container.AddCap(x =>
  14. {
  15. //console app does not support dashboard
  16. x.UseMySql("<ConnectionString>");
  17. x.UseRabbitMQ(z =>
  18. {
  19. z.HostName = "192.168.3.57";
  20. z.UserName = "user";
  21. z.Password = "wJ0p5gSs17";
  22. });
  23. });
  24. container.AddSingleton<EventSubscriber>();
  25. var sp = container.BuildServiceProvider();
  26. sp.GetService<IBootstrapper>().BootstrapAsync(default);
  27. Console.ReadLine();
  28. }
  29. }
  30. }