@@ -7,8 +7,8 @@ namespace Sample.Kafka.SqlServer | |||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) | 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"); | |||||
} | } | ||||
} | } | ||||
} | } |
@@ -15,7 +15,7 @@ namespace Sample.Kafka.SqlServer | |||||
services.AddCap(x => | services.AddCap(x => | ||||
{ | { | ||||
x.UseEntityFramework<AppDbContext>(); | x.UseEntityFramework<AppDbContext>(); | ||||
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.UseDashboard(); | ||||
x.UseDiscovery(d => | x.UseDiscovery(d => | ||||
{ | { | ||||
@@ -10,8 +10,8 @@ namespace Sample.RabbitMQ.MySql | |||||
{ | { | ||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) | 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;"); | |||||
} | } | ||||
} | } | ||||
} | } |
@@ -17,7 +17,7 @@ | |||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.0" /> | <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.0" /> | ||||
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="2.0.0" /> | <PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="2.0.0" /> | ||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.0.0" /> | <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.0.0" /> | ||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.0.0-rtm-10056" /> | |||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.0.0" /> | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0" /> | <DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0" /> | ||||
@@ -18,11 +18,7 @@ namespace Sample.RabbitMQ.MySql | |||||
services.AddCap(x => | services.AddCap(x => | ||||
{ | { | ||||
x.UseEntityFramework<AppDbContext>(); | x.UseEntityFramework<AppDbContext>(); | ||||
x.UseRabbitMQ(y => { | |||||
y.HostName = "192.168.2.206"; | |||||
y.UserName = "admin"; | |||||
y.Password = "123123"; | |||||
}); | |||||
x.UseRabbitMQ("localhost"); | |||||
x.UseDashboard(); | x.UseDashboard(); | ||||
x.UseDiscovery(d => | x.UseDiscovery(d => | ||||
{ | { | ||||
@@ -10,7 +10,7 @@ namespace Sample.RabbitMQ.PostgreSql | |||||
{ | { | ||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) | 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;"); | |||||
} | } | ||||
} | } | ||||
} | } |
@@ -13,15 +13,11 @@ namespace Sample.RabbitMQ.PostgreSql | |||||
// This method gets called by the runtime. Use this method to add services to the container. | // This method gets called by the runtime. Use this method to add services to the container. | ||||
public void ConfigureServices(IServiceCollection services) | public void ConfigureServices(IServiceCollection services) | ||||
{ | { | ||||
services.AddDbContext<AppDbContext>(); | |||||
services.AddCap(x => | services.AddCap(x => | ||||
{ | { | ||||
x.UseEntityFramework<AppDbContext>(); | x.UseEntityFramework<AppDbContext>(); | ||||
x.UseRabbitMQ(z => | |||||
{ | |||||
z.HostName = "192.168.2.206"; | |||||
z.UserName = "admin"; | |||||
z.Password = "123123"; | |||||
}); | |||||
x.UseRabbitMQ("localhost"); | |||||
x.UseDashboard(); | x.UseDashboard(); | ||||
x.UseDiscovery(d => | x.UseDiscovery(d => | ||||
{ | { | ||||
@@ -29,7 +25,7 @@ namespace Sample.RabbitMQ.PostgreSql | |||||
d.DiscoveryServerPort = 8500; | d.DiscoveryServerPort = 8500; | ||||
d.CurrentNodeHostName = "localhost"; | d.CurrentNodeHostName = "localhost"; | ||||
d.CurrentNodePort = 5800; | d.CurrentNodePort = 5800; | ||||
d.NodeName = "CAP一号节点"; | |||||
d.NodeName = "CAP 一号节点"; | |||||
}); | }); | ||||
}); | }); | ||||
services.AddMvc(); | services.AddMvc(); | ||||
@@ -10,8 +10,8 @@ namespace Sample.RabbitMQ.SqlServer | |||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) | 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"); | |||||
} | } | ||||
} | } | ||||
} | } |
@@ -8,21 +8,7 @@ namespace Sample.RabbitMQ.SqlServer | |||||
{ | { | ||||
public class Program | public class Program | ||||
{ | { | ||||
//var config = new ConfigurationBuilder() | |||||
// .AddCommandLine(args) | |||||
// .AddEnvironmentVariables("ASPNETCORE_") | |||||
// .Build(); | |||||
//var host = new WebHostBuilder() | |||||
// .UseConfiguration(config) | |||||
// .UseKestrel() | |||||
// .UseContentRoot(Directory.GetCurrentDirectory()) | |||||
// .UseIISIntegration() | |||||
// .UseStartup<Startup>() | |||||
// .Build(); | |||||
//host.Run(); | |||||
public static void Main(string[] args) | public static void Main(string[] args) | ||||
{ | { | ||||
BuildWebHost(args).Run(); | BuildWebHost(args).Run(); | ||||
@@ -30,6 +16,7 @@ namespace Sample.RabbitMQ.SqlServer | |||||
public static IWebHost BuildWebHost(string[] args) => | public static IWebHost BuildWebHost(string[] args) => | ||||
WebHost.CreateDefaultBuilder(args) | WebHost.CreateDefaultBuilder(args) | ||||
.UseUrls("http://*:5800") | |||||
.UseStartup<Startup>() | .UseStartup<Startup>() | ||||
.Build(); | .Build(); | ||||
@@ -19,20 +19,17 @@ namespace Sample.RabbitMQ.SqlServer | |||||
services.AddCap(x => | services.AddCap(x => | ||||
{ | { | ||||
x.UseEntityFramework<AppDbContext>(); | x.UseEntityFramework<AppDbContext>(); | ||||
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 => | x.UseDiscovery(d => | ||||
{ | { | ||||
d.DiscoveryServerHostName = "localhost"; | d.DiscoveryServerHostName = "localhost"; | ||||
d.DiscoveryServerPort = 8500; | d.DiscoveryServerPort = 8500; | ||||
d.CurrentNodeHostName = "localhost"; | |||||
d.CurrentNodeHostName = "192.168.1.11"; | |||||
d.CurrentNodePort = 5800; | d.CurrentNodePort = 5800; | ||||
d.NodeName = "CAP一号节点"; | |||||
d.NodeName = "CAP Node Windows"; | |||||
d.NodeId = 1; | |||||
}); | }); | ||||
}); | }); | ||||
@@ -12,7 +12,7 @@ | |||||
<PackageReference Include="Dapper" Version="1.50.2" /> | <PackageReference Include="Dapper" Version="1.50.2" /> | ||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.0.0" /> | <PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.0.0" /> | ||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="2.0.0" /> | <PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="2.0.0" /> | ||||
<PackageReference Include="MySqlConnector" Version="0.27.0" /> | |||||
<PackageReference Include="MySqlConnector" Version="0.28.0" /> | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
@@ -16,12 +16,12 @@ | |||||
<ItemGroup> | <ItemGroup> | ||||
<PackageReference Include="Dapper" Version="1.50.2" /> | <PackageReference Include="Dapper" Version="1.50.2" /> | ||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20170810-02" /> | <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20170810-02" /> | ||||
<PackageReference Include="MySqlConnector" Version="0.26.5" /> | |||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta3-build3705" /> | |||||
<PackageReference Include="xunit" Version="2.3.0-beta3-build3705" /> | |||||
<PackageReference Include="MySqlConnector" Version="0.28.0" /> | |||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0" /> | |||||
<PackageReference Include="xunit" Version="2.3.0" /> | |||||
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.0.0" /> | <PackageReference Include="Microsoft.AspNetCore.Http" Version="2.0.0" /> | ||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.0.0" /> | <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.0.0" /> | ||||
<PackageReference Include="Moq" Version="4.7.99" /> | |||||
<PackageReference Include="Moq" Version="4.7.137" /> | |||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.0.0" /> | <PackageReference Include="Microsoft.Extensions.Logging" Version="2.0.0" /> | ||||
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="2.0.0" /> | <PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="2.0.0" /> | ||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.0.0" /> | <PackageReference Include="Microsoft.Extensions.Configuration" Version="2.0.0" /> | ||||
@@ -10,8 +10,8 @@ | |||||
<PackageReference Include="Dapper" Version="1.50.2" /> | <PackageReference Include="Dapper" Version="1.50.2" /> | ||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20170810-02" /> | <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20170810-02" /> | ||||
<PackageReference Include="Npgsql" Version="3.2.5" /> | <PackageReference Include="Npgsql" Version="3.2.5" /> | ||||
<PackageReference Include="xunit" Version="2.3.0-beta3-build3705" /> | |||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta3-build3705" /> | |||||
<PackageReference Include="xunit" Version="2.3.0" /> | |||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0" /> | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
@@ -14,11 +14,11 @@ | |||||
<PackageReference Include="Dapper" Version="1.50.2" /> | <PackageReference Include="Dapper" Version="1.50.2" /> | ||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20170810-02" /> | <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20170810-02" /> | ||||
<PackageReference Include="System.Data.SqlClient" Version="4.4.0" /> | <PackageReference Include="System.Data.SqlClient" Version="4.4.0" /> | ||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta3-build3705" /> | |||||
<PackageReference Include="xunit" Version="2.3.0-beta3-build3705" /> | |||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0" /> | |||||
<PackageReference Include="xunit" Version="2.3.0" /> | |||||
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.0.0" /> | <PackageReference Include="Microsoft.AspNetCore.Http" Version="2.0.0" /> | ||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.0.0" /> | <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.0.0" /> | ||||
<PackageReference Include="Moq" Version="4.7.99" /> | |||||
<PackageReference Include="Moq" Version="4.7.137" /> | |||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.0.0" /> | <PackageReference Include="Microsoft.Extensions.Logging" Version="2.0.0" /> | ||||
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="2.0.0" /> | <PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="2.0.0" /> | ||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.0.0" /> | <PackageReference Include="Microsoft.Extensions.Configuration" Version="2.0.0" /> | ||||
@@ -10,11 +10,11 @@ | |||||
<ItemGroup> | <ItemGroup> | ||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20170810-02" /> | <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20170810-02" /> | ||||
<PackageReference Include="System.Data.Common" Version="4.3.0" /> | <PackageReference Include="System.Data.Common" Version="4.3.0" /> | ||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta3-build3705" /> | |||||
<PackageReference Include="xunit" Version="2.3.0-beta3-build3705" /> | |||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0" /> | |||||
<PackageReference Include="xunit" Version="2.3.0" /> | |||||
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.0.0" /> | <PackageReference Include="Microsoft.AspNetCore.Http" Version="2.0.0" /> | ||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.0.0" /> | <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.0.0" /> | ||||
<PackageReference Include="Moq" Version="4.7.99" /> | |||||
<PackageReference Include="Moq" Version="4.7.137" /> | |||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.0.0" /> | <PackageReference Include="Microsoft.Extensions.Logging" Version="2.0.0" /> | ||||
</ItemGroup> | </ItemGroup> | ||||