diff --git a/samples/Sample.Kafka.SqlServer/AppDbContext.cs b/samples/Sample.Kafka.SqlServer/AppDbContext.cs index b5ea8d8..5dd398b 100644 --- a/samples/Sample.Kafka.SqlServer/AppDbContext.cs +++ b/samples/Sample.Kafka.SqlServer/AppDbContext.cs @@ -7,8 +7,8 @@ namespace Sample.Kafka.SqlServer protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { - optionsBuilder.UseSqlServer("Server=192.168.2.206;Initial Catalog=Sample.Kafka.SqlServer;User Id=cmswuliu;Password=h7xY81agBn*Veiu3;MultipleActiveResultSets=True"); - // optionsBuilder.UseSqlServer("Server=DESKTOP-M9R8T31;Initial Catalog=Sample.Kafka.SqlServer;User Id=sa;Password=P@ssw0rd;MultipleActiveResultSets=True"); + //optionsBuilder.UseSqlServer("Server=192.168.2.206;Initial Catalog=Sample.Kafka.SqlServer;User Id=cmswuliu;Password=h7xY81agBn*Veiu3;MultipleActiveResultSets=True"); + optionsBuilder.UseSqlServer("Server=DESKTOP-M9R8T31;Initial Catalog=Sample.Kafka.SqlServer;User Id=sa;Password=P@ssw0rd;MultipleActiveResultSets=True"); } } } diff --git a/samples/Sample.Kafka.SqlServer/Startup.cs b/samples/Sample.Kafka.SqlServer/Startup.cs index de9962c..75b7e58 100644 --- a/samples/Sample.Kafka.SqlServer/Startup.cs +++ b/samples/Sample.Kafka.SqlServer/Startup.cs @@ -15,7 +15,7 @@ namespace Sample.Kafka.SqlServer services.AddCap(x => { x.UseEntityFramework(); - x.UseKafka("192.168.2.227:9091,192.168.2.227:9092,192.168.2.222:9092"); + x.UseKafka("192.168.1.26:9092"); x.UseDashboard(); x.UseDiscovery(d => { diff --git a/samples/Sample.RabbitMQ.MySql/AppDbContext.cs b/samples/Sample.RabbitMQ.MySql/AppDbContext.cs index cf3c96d..ae559e5 100644 --- a/samples/Sample.RabbitMQ.MySql/AppDbContext.cs +++ b/samples/Sample.RabbitMQ.MySql/AppDbContext.cs @@ -10,8 +10,8 @@ namespace Sample.RabbitMQ.MySql { protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { - //optionsBuilder.UseMySql("Server=localhost;Database=Sample.RabbitMQ.MySql;UserId=root;Password=123123;"); - optionsBuilder.UseMySql("Server=192.168.2.206;Database=Sample.RabbitMQ.MySql;UserId=root;Password=123123;"); + optionsBuilder.UseMySql("Server=localhost;Database=Sample.RabbitMQ.MySql;UserId=root;Password=123123;"); + //optionsBuilder.UseMySql("Server=192.168.2.206;Database=Sample.RabbitMQ.MySql;UserId=root;Password=123123;"); } } } diff --git a/samples/Sample.RabbitMQ.MySql/Sample.RabbitMQ.MySql.csproj b/samples/Sample.RabbitMQ.MySql/Sample.RabbitMQ.MySql.csproj index 1c67eb0..ce009e8 100644 --- a/samples/Sample.RabbitMQ.MySql/Sample.RabbitMQ.MySql.csproj +++ b/samples/Sample.RabbitMQ.MySql/Sample.RabbitMQ.MySql.csproj @@ -17,7 +17,7 @@ - + diff --git a/samples/Sample.RabbitMQ.MySql/Startup.cs b/samples/Sample.RabbitMQ.MySql/Startup.cs index 3ffdd7d..0974510 100644 --- a/samples/Sample.RabbitMQ.MySql/Startup.cs +++ b/samples/Sample.RabbitMQ.MySql/Startup.cs @@ -18,11 +18,7 @@ namespace Sample.RabbitMQ.MySql services.AddCap(x => { x.UseEntityFramework(); - x.UseRabbitMQ(y => { - y.HostName = "192.168.2.206"; - y.UserName = "admin"; - y.Password = "123123"; - }); + x.UseRabbitMQ("localhost"); x.UseDashboard(); x.UseDiscovery(d => { diff --git a/samples/Sample.RabbitMQ.PostgreSql/AppDbContext.cs b/samples/Sample.RabbitMQ.PostgreSql/AppDbContext.cs index 4fefe5c..d4bde28 100644 --- a/samples/Sample.RabbitMQ.PostgreSql/AppDbContext.cs +++ b/samples/Sample.RabbitMQ.PostgreSql/AppDbContext.cs @@ -10,7 +10,7 @@ namespace Sample.RabbitMQ.PostgreSql { protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { - optionsBuilder.UseNpgsql("Server=localhost;Database=Sample.RabbitMQ.PostgreSql;UserId=postgre;Password=123123;"); + optionsBuilder.UseNpgsql("Server=localhost;Database=Sample.RabbitMQ.PostgreSql;UserId=postgres;Password=123123;"); } } } diff --git a/samples/Sample.RabbitMQ.PostgreSql/Startup.cs b/samples/Sample.RabbitMQ.PostgreSql/Startup.cs index 4c0d950..b0477c0 100644 --- a/samples/Sample.RabbitMQ.PostgreSql/Startup.cs +++ b/samples/Sample.RabbitMQ.PostgreSql/Startup.cs @@ -13,15 +13,11 @@ namespace Sample.RabbitMQ.PostgreSql // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { + services.AddDbContext(); services.AddCap(x => { x.UseEntityFramework(); - x.UseRabbitMQ(z => - { - z.HostName = "192.168.2.206"; - z.UserName = "admin"; - z.Password = "123123"; - }); + x.UseRabbitMQ("localhost"); x.UseDashboard(); x.UseDiscovery(d => { @@ -29,7 +25,7 @@ namespace Sample.RabbitMQ.PostgreSql d.DiscoveryServerPort = 8500; d.CurrentNodeHostName = "localhost"; d.CurrentNodePort = 5800; - d.NodeName = "CAP一号节点"; + d.NodeName = "CAP 一号节点"; }); }); services.AddMvc(); diff --git a/samples/Sample.RabbitMQ.SqlServer/AppDbContext.cs b/samples/Sample.RabbitMQ.SqlServer/AppDbContext.cs index 74b0bc8..1ba1fdb 100644 --- a/samples/Sample.RabbitMQ.SqlServer/AppDbContext.cs +++ b/samples/Sample.RabbitMQ.SqlServer/AppDbContext.cs @@ -10,8 +10,8 @@ namespace Sample.RabbitMQ.SqlServer protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { - optionsBuilder.UseSqlServer("Server=192.168.2.206;Initial Catalog=TestCap;User Id=cmswuliu;Password=h7xY81agBn*Veiu3;MultipleActiveResultSets=True"); - // optionsBuilder.UseSqlServer("Server=DESKTOP-M9R8T31;Initial Catalog=Sample.Kafka.SqlServer;User Id=sa;Password=P@ssw0rd;MultipleActiveResultSets=True"); + //optionsBuilder.UseSqlServer("Server=192.168.2.206;Initial Catalog=TestCap;User Id=cmswuliu;Password=h7xY81agBn*Veiu3;MultipleActiveResultSets=True"); + optionsBuilder.UseSqlServer("Server=DESKTOP-M9R8T31;Initial Catalog=Sample.Kafka.SqlServer;User Id=sa;Password=P@ssw0rd;MultipleActiveResultSets=True"); } } } diff --git a/samples/Sample.RabbitMQ.SqlServer/Program.cs b/samples/Sample.RabbitMQ.SqlServer/Program.cs index d5000ea..ebbd50e 100644 --- a/samples/Sample.RabbitMQ.SqlServer/Program.cs +++ b/samples/Sample.RabbitMQ.SqlServer/Program.cs @@ -8,21 +8,7 @@ namespace Sample.RabbitMQ.SqlServer { public class Program { - - //var config = new ConfigurationBuilder() - // .AddCommandLine(args) - // .AddEnvironmentVariables("ASPNETCORE_") - // .Build(); - - //var host = new WebHostBuilder() - // .UseConfiguration(config) - // .UseKestrel() - // .UseContentRoot(Directory.GetCurrentDirectory()) - // .UseIISIntegration() - // .UseStartup() - // .Build(); - - //host.Run(); + public static void Main(string[] args) { BuildWebHost(args).Run(); @@ -30,6 +16,7 @@ namespace Sample.RabbitMQ.SqlServer public static IWebHost BuildWebHost(string[] args) => WebHost.CreateDefaultBuilder(args) + .UseUrls("http://*:5800") .UseStartup() .Build(); diff --git a/samples/Sample.RabbitMQ.SqlServer/Startup.cs b/samples/Sample.RabbitMQ.SqlServer/Startup.cs index bea6082..4821b97 100644 --- a/samples/Sample.RabbitMQ.SqlServer/Startup.cs +++ b/samples/Sample.RabbitMQ.SqlServer/Startup.cs @@ -19,20 +19,17 @@ namespace Sample.RabbitMQ.SqlServer services.AddCap(x => { x.UseEntityFramework(); - x.UseRabbitMQ(z => - { - z.HostName = "192.168.2.206"; - z.UserName = "admin"; - z.Password = "123123"; - }); - x.UseDashboard(d => { d.StatsPollingInterval = 1000000; }); + x.UseRabbitMQ("localhost"); + x.UseDashboard(); x.UseDiscovery(d => { d.DiscoveryServerHostName = "localhost"; d.DiscoveryServerPort = 8500; - d.CurrentNodeHostName = "localhost"; + + d.CurrentNodeHostName = "192.168.1.11"; d.CurrentNodePort = 5800; - d.NodeName = "CAP一号节点"; + d.NodeName = "CAP Node Windows"; + d.NodeId = 1; }); }); diff --git a/src/DotNetCore.CAP.MySql/DotNetCore.CAP.MySql.csproj b/src/DotNetCore.CAP.MySql/DotNetCore.CAP.MySql.csproj index 4a580e8..7e2b83e 100644 --- a/src/DotNetCore.CAP.MySql/DotNetCore.CAP.MySql.csproj +++ b/src/DotNetCore.CAP.MySql/DotNetCore.CAP.MySql.csproj @@ -12,7 +12,7 @@ - + diff --git a/test/DotNetCore.CAP.MySql.Test/DotNetCore.CAP.MySql.Test.csproj b/test/DotNetCore.CAP.MySql.Test/DotNetCore.CAP.MySql.Test.csproj index deafe18..3042946 100644 --- a/test/DotNetCore.CAP.MySql.Test/DotNetCore.CAP.MySql.Test.csproj +++ b/test/DotNetCore.CAP.MySql.Test/DotNetCore.CAP.MySql.Test.csproj @@ -16,12 +16,12 @@ - - - + + + - + diff --git a/test/DotNetCore.CAP.PostgreSql.Test/DotNetCore.CAP.PostgreSql.Test.csproj b/test/DotNetCore.CAP.PostgreSql.Test/DotNetCore.CAP.PostgreSql.Test.csproj index 25cef47..42c4471 100644 --- a/test/DotNetCore.CAP.PostgreSql.Test/DotNetCore.CAP.PostgreSql.Test.csproj +++ b/test/DotNetCore.CAP.PostgreSql.Test/DotNetCore.CAP.PostgreSql.Test.csproj @@ -10,8 +10,8 @@ - - + + diff --git a/test/DotNetCore.CAP.SqlServer.Test/DotNetCore.CAP.SqlServer.Test.csproj b/test/DotNetCore.CAP.SqlServer.Test/DotNetCore.CAP.SqlServer.Test.csproj index 1a8cc9a..301ada2 100644 --- a/test/DotNetCore.CAP.SqlServer.Test/DotNetCore.CAP.SqlServer.Test.csproj +++ b/test/DotNetCore.CAP.SqlServer.Test/DotNetCore.CAP.SqlServer.Test.csproj @@ -14,11 +14,11 @@ - - + + - + diff --git a/test/DotNetCore.CAP.Test/DotNetCore.CAP.Test.csproj b/test/DotNetCore.CAP.Test/DotNetCore.CAP.Test.csproj index b4d7bae..7d96d98 100644 --- a/test/DotNetCore.CAP.Test/DotNetCore.CAP.Test.csproj +++ b/test/DotNetCore.CAP.Test/DotNetCore.CAP.Test.csproj @@ -10,11 +10,11 @@ - - + + - +