@@ -0,0 +1,19 @@ | |||
<Project Sdk="Microsoft.NET.Sdk.Web"> | |||
<PropertyGroup> | |||
<TargetFramework>net6.0</TargetFramework> | |||
<Nullable>enable</Nullable> | |||
<ImplicitUsings>enable</ImplicitUsings> | |||
</PropertyGroup> | |||
<ItemGroup> | |||
<PackageReference Include="BPA.ApolloClient" Version="1.0.4" /> | |||
<PackageReference Include="SqlSugarCore" Version="5.0.6.7" /> | |||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\BPA.CAP\BPA.CAP.csproj" /> | |||
</ItemGroup> | |||
</Project> |
@@ -0,0 +1,81 @@ | |||
using BAP.Cap.Sqlsugar.Demo1.Entity; | |||
using DotNetCore.CAP; | |||
using Microsoft.AspNetCore.Mvc; | |||
using Microsoft.Data.SqlClient; | |||
using SqlSugar; | |||
using System.Data; | |||
namespace BAP.Cap.Sqlsugar.Demo1.Controllers | |||
{ | |||
[ApiController] | |||
[Route("[controller]")] | |||
public class WeatherForecastController : ControllerBase | |||
{ | |||
private static readonly string[] Summaries = new[] | |||
{ | |||
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" | |||
}; | |||
private readonly ILogger<WeatherForecastController> _logger; | |||
private ICapPublisher _capBus; | |||
private SqlSugarScope _sqlSugarScope; | |||
public WeatherForecastController(ILogger<WeatherForecastController> logger, ICapPublisher capPublisher, SqlSugarScope sqlSugarScope) | |||
{ | |||
_sqlSugarScope= sqlSugarScope; | |||
_logger = logger; | |||
_capBus = capPublisher; | |||
} | |||
[HttpGet,Route("TestPublish")] | |||
public async Task TestPublish() | |||
{ | |||
await _capBus.PublishAsync("sample.rabbitmq.sqlserver", DateTime.Now); | |||
} | |||
[HttpGet,Route("~/adonet/transaction")] | |||
public IActionResult AdonetWithTransaction() | |||
{ | |||
//_sqlSugarScope.ScopedContext.BeginTran | |||
//_sqlSugarScope.GetConnection(1) | |||
//_sqlSugarScope.ScopedContext.UseTran(). | |||
//IDbConnection. | |||
using (var connection =(SqlConnection) _sqlSugarScope.Ado.Connection ) | |||
{ | |||
using (var transaction = connection.BeginTransaction(_capBus, false)) | |||
{ | |||
if (connection.State != ConnectionState.Open) | |||
{ | |||
connection.Open(); | |||
} | |||
_sqlSugarScope.Ado.Transaction =transaction; | |||
//_sqlSugarScope.Insertable<Num>(new Num() | |||
//{ | |||
// Id = 1, | |||
// Number1 = 2 | |||
//}).ExecuteCommand(); | |||
_capBus.Publish("sample.rabbitmq.sqlserver.transaction", "Ö´ÐÐ"); | |||
transaction.Commit(); | |||
} | |||
} | |||
return Ok(); | |||
} | |||
[HttpGet(Name = "GetWeatherForecast")] | |||
public IEnumerable<WeatherForecast> Get() | |||
{ | |||
return Enumerable.Range(1, 5).Select(index => new WeatherForecast | |||
{ | |||
Date = DateTime.Now.AddDays(index), | |||
TemperatureC = Random.Shared.Next(-20, 55), | |||
Summary = Summaries[Random.Shared.Next(Summaries.Length)] | |||
}) | |||
.ToArray(); | |||
} | |||
} | |||
} |
@@ -0,0 +1,12 @@ | |||
using SqlSugar; | |||
namespace BAP.Cap.Sqlsugar.Demo1.Entity | |||
{ | |||
[SugarTable("Num")] | |||
public class Num | |||
{ | |||
public int Id { get; set; } | |||
public int Number1 { get; set; } | |||
} | |||
} |
@@ -0,0 +1,53 @@ | |||
using BAP.CAP; | |||
using BPA.CAP.Settings; | |||
using BPA.Component.ApolloClient; | |||
using SqlSugar; | |||
var builder = WebApplication.CreateBuilder(args); | |||
// Add services to the container. | |||
builder.Services.AddApolloConfiguration(builder); | |||
builder.Services.AddCapConfiguration(builder.Configuration,new CapSettings | |||
{ | |||
FailedThresholdCallback = fail => | |||
{ | |||
var mess = fail.Message; | |||
} | |||
}); | |||
//SqlSugarScope db = new SqlSugarScope(new ConnectionConfig() | |||
//{ | |||
// ConnectionString = builder.Configuration.GetSection("ConnectionStrings").Value,//连接符字串 | |||
// DbType = DbType.SqlServer,//数据库类型 | |||
// IsAutoCloseConnection = true //不设成true要手动close | |||
//} | |||
//); | |||
//db.Aop.OnLogExecuted = (sql, pars) => | |||
//{ | |||
//}; | |||
//builder.Services.AddSingleton(db); | |||
builder.Services.AddControllers(); | |||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle | |||
builder.Services.AddEndpointsApiExplorer(); | |||
builder.Services.AddSwaggerGen(c => | |||
{ | |||
c.ResolveConflictingActions(apiDescriptions => apiDescriptions.First()); | |||
}); | |||
var app = builder.Build(); | |||
// Configure the HTTP request pipeline. | |||
if (app.Environment.IsDevelopment()) | |||
{ | |||
app.UseSwagger(); | |||
app.UseSwaggerUI(); | |||
} | |||
app.UseAuthorization(); | |||
app.MapControllers(); | |||
app.Run(); |
@@ -0,0 +1,13 @@ | |||
namespace BAP.Cap.Sqlsugar.Demo1 | |||
{ | |||
public class WeatherForecast | |||
{ | |||
public DateTime Date { get; set; } | |||
public int TemperatureC { get; set; } | |||
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); | |||
public string? Summary { get; set; } | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
{ | |||
"Logging": { | |||
"LogLevel": { | |||
"Default": "Information", | |||
"Microsoft.AspNetCore": "Warning" | |||
} | |||
} | |||
} |
@@ -0,0 +1,19 @@ | |||
{ | |||
"Logging": { | |||
"LogLevel": { | |||
"Default": "Information", | |||
"Microsoft.AspNetCore": "Warning" | |||
} | |||
}, | |||
"AllowedHosts": "*", | |||
// "ConnectionStrings": "Data Source=10.2.1.21;Initial Catalog=demo1;MultipleActiveResultSets=true;Persist Security Info=True;User ID=sa;Password=BapAdmin123456.;" | |||
"ApolloClientSettings": { | |||
"Host": "http://10.2.1.21", | |||
"Port": 28080, | |||
"Env": "Dev", | |||
"CommonNameSpace": "DEV.Config", | |||
"ClientNameSpace": "application", | |||
"AppId": "dev1_order" | |||
} | |||
} |
@@ -0,0 +1,18 @@ | |||
<Project Sdk="Microsoft.NET.Sdk.Web"> | |||
<PropertyGroup> | |||
<TargetFramework>net6.0</TargetFramework> | |||
<Nullable>enable</Nullable> | |||
<ImplicitUsings>enable</ImplicitUsings> | |||
</PropertyGroup> | |||
<ItemGroup> | |||
<PackageReference Include="SqlSugarCore" Version="5.0.6.7" /> | |||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\BAP.Cap.Sqlsugar\BAP.Cap.Sqlsugar.csproj" /> | |||
</ItemGroup> | |||
</Project> |
@@ -0,0 +1,64 @@ | |||
using DotNetCore.CAP; | |||
using Microsoft.AspNetCore.Mvc; | |||
namespace BAP.Cap.Sqlsugar.Demo2.Controllers | |||
{ | |||
[ApiController] | |||
[Route("[controller]")] | |||
public class WeatherForecastController : ControllerBase | |||
{ | |||
private static readonly string[] Summaries = new[] | |||
{ | |||
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" | |||
}; | |||
private readonly ILogger<WeatherForecastController> _logger; | |||
private ICapPublisher _capBus; | |||
public WeatherForecastController(ILogger<WeatherForecastController> logger, ICapPublisher capPublisher) | |||
{ | |||
_logger = logger; | |||
_capBus = capPublisher; | |||
} | |||
[NonAction] | |||
[CapSubscribe("sample.rabbitmq.sqlserver")] | |||
public void TestSubscribe(string message) | |||
{ | |||
Console.WriteLine("收到消息:" + message); | |||
} | |||
[NonAction] | |||
[CapSubscribe("sample.rabbitmq.sqlserver.transaction")] | |||
public void TestSubscribetransaction(string message) | |||
{ | |||
Console.WriteLine("收到消息:" + message); | |||
} | |||
//[NonAction] | |||
//[CapSubscribe("sample.rabbitmq.sqlserver")] | |||
//public void TestPublish(string message) | |||
//{ | |||
// Console.WriteLine("收到消息:" + message); | |||
//} | |||
[HttpGet(Name = "GetWeatherForecast")] | |||
public IEnumerable<WeatherForecast> Get() | |||
{ | |||
return Enumerable.Range(1, 5).Select(index => new WeatherForecast | |||
{ | |||
Date = DateTime.Now.AddDays(index), | |||
TemperatureC = Random.Shared.Next(-20, 55), | |||
Summary = Summaries[Random.Shared.Next(Summaries.Length)] | |||
}) | |||
.ToArray(); | |||
} | |||
} | |||
} |
@@ -0,0 +1,12 @@ | |||
using SqlSugar; | |||
namespace BAP.Cap.Sqlsugar.Demo2.Entity | |||
{ | |||
[SugarTable("Num")] | |||
public class Num | |||
{ | |||
public int Id { get; set; } | |||
public int Number2 { get; set; } | |||
} | |||
} |
@@ -0,0 +1,42 @@ | |||
using BAP.Cap.Sqlsugar; | |||
using SqlSugar; | |||
var builder = WebApplication.CreateBuilder(args); | |||
// Add services to the container. | |||
builder.Services.AddCapConfiguration(builder.Configuration); | |||
SqlSugarScope db = new SqlSugarScope(new ConnectionConfig() | |||
{ | |||
ConnectionString = builder.Configuration.GetSection("ConnectionStrings").Value,//连接符字串 | |||
DbType = DbType.SqlServer,//数据库类型 | |||
IsAutoCloseConnection = true //不设成true要手动close | |||
} | |||
); | |||
db.Aop.OnLogExecuted = (sql, pars) => | |||
{ | |||
}; | |||
builder.Services.AddControllers(); | |||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle | |||
builder.Services.AddEndpointsApiExplorer(); | |||
builder.Services.AddSwaggerGen(c => | |||
{ | |||
c.ResolveConflictingActions(apiDescriptions => apiDescriptions.First()); | |||
}); | |||
var app = builder.Build(); | |||
// Configure the HTTP request pipeline. | |||
if (app.Environment.IsDevelopment()) | |||
{ | |||
app.UseSwagger(); | |||
app.UseSwaggerUI(); | |||
} | |||
app.UseAuthorization(); | |||
app.MapControllers(); | |||
app.Run(); |
@@ -0,0 +1,13 @@ | |||
namespace BAP.Cap.Sqlsugar.Demo2 | |||
{ | |||
public class WeatherForecast | |||
{ | |||
public DateTime Date { get; set; } | |||
public int TemperatureC { get; set; } | |||
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); | |||
public string? Summary { get; set; } | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
{ | |||
"Logging": { | |||
"LogLevel": { | |||
"Default": "Information", | |||
"Microsoft.AspNetCore": "Warning" | |||
} | |||
} | |||
} |
@@ -0,0 +1,10 @@ | |||
{ | |||
"Logging": { | |||
"LogLevel": { | |||
"Default": "Information", | |||
"Microsoft.AspNetCore": "Warning" | |||
} | |||
}, | |||
"AllowedHosts": "*", | |||
"ConnectionStrings": "Data Source=10.2.1.21;Initial Catalog=demo2;MultipleActiveResultSets=true;Persist Security Info=True;User ID=sa;Password=BapAdmin123456.;" | |||
} |
@@ -0,0 +1,22 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> | |||
<PropertyGroup> | |||
<TargetFramework>net6.0</TargetFramework> | |||
<ImplicitUsings>enable</ImplicitUsings> | |||
<Nullable>enable</Nullable> | |||
</PropertyGroup> | |||
<ItemGroup> | |||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" /> | |||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" /> | |||
<PackageReference Include="SqlSugarCore" Version="5.0.6.7" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\src\DotNetCore.CAP.Dashboard\DotNetCore.CAP.Dashboard.csproj" /> | |||
<ProjectReference Include="..\src\DotNetCore.CAP.RabbitMQ\DotNetCore.CAP.RabbitMQ.csproj" /> | |||
<ProjectReference Include="..\src\DotNetCore.CAP.SqlServer\DotNetCore.CAP.SqlServer.csproj" /> | |||
<ProjectReference Include="..\src\DotNetCore.CAP\DotNetCore.CAP.csproj" /> | |||
</ItemGroup> | |||
</Project> |
@@ -0,0 +1,77 @@ | |||
using Microsoft.AspNetCore.Builder; | |||
using Microsoft.Extensions.Configuration; | |||
using Microsoft.Extensions.DependencyInjection; | |||
using Microsoft.Extensions.Logging; | |||
using SqlSugar; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Text.Encodings.Web; | |||
using System.Text.Unicode; | |||
using System.Threading.Tasks; | |||
namespace BAP.Cap.Sqlsugar | |||
{ | |||
/// <summary> | |||
/// CAP扩展 | |||
/// </summary> | |||
public static class CapExtensions | |||
{ | |||
public static IServiceCollection AddCapConfiguration(this IServiceCollection services, IConfiguration configuration) | |||
{ | |||
var dbConfig= configuration.GetSection("ConnectionStrings").Value; | |||
// }; | |||
services.AddCap(x => { | |||
x.UseSqlServer(dbConfig); | |||
x.UseRabbitMQ(options => | |||
{ | |||
options.HostName = "10.2.1.21"; | |||
options.UserName = "guest"; | |||
options.Password = "guest"; | |||
}); | |||
x.UseDashboard(); | |||
x.FailedRetryCount = 5; | |||
x.FailedThresholdCallback = failed => | |||
{ | |||
//var logger = failed.ServiceProvider.GetService<ILogger<Startup>>(); | |||
//logger.LogError($@"A message of type {failed.MessageType} failed after executing {x.FailedRetryCount} several times, | |||
// requiring manual troubleshooting. Message name: {failed.Message.GetName()}"); | |||
}; | |||
x.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All); | |||
}); | |||
// db.ScopedContext | |||
//, db => | |||
// { | |||
// //(A)全局生效配置点 | |||
// //调试SQL事件,可以删掉 | |||
// db.Aop.OnLogExecuting = (sql, pars) => | |||
// { | |||
// Console.WriteLine(sql);//输出sql,查看执行sql | |||
// }; | |||
// } | |||
// ApolloClientSettings metaServerSettings = new ApolloClientSettings(); | |||
// builder.Configuration.GetSection(nameof(ApolloClientSettings)).Bind(metaServerSettings); | |||
// services.AddSingleton(metaServerSettings); | |||
//#pragma warning disable CS8601 // 引用类型赋值可能为 null。 | |||
//#pragma warning disable CS8604 // 引用类型参数可能为 null。 | |||
// var apollo = builder.Configuration.AddApollo(new ApolloOptions | |||
// { | |||
// AppId = metaServerSettings.AppId, | |||
// MetaServer = metaServerSettings.Host + ":" + metaServerSettings.Port, | |||
// Env = metaServerSettings.Env, | |||
// }).AddNamespace(metaServerSettings.CommonNameSpace).AddNamespace(metaServerSettings.ClientNameSpace); | |||
//#pragma warning restore CS8604 // 引用类型参数可能为 null。 | |||
//#pragma warning restore CS8601 // 引用类型赋值可能为 null。 | |||
return services; | |||
} | |||
} | |||
} |
@@ -0,0 +1,19 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> | |||
<PropertyGroup> | |||
<TargetFramework>net6.0</TargetFramework> | |||
<ImplicitUsings>enable</ImplicitUsings> | |||
<Nullable>enable</Nullable> | |||
<VersionPrefix>1.0.1</VersionPrefix> | |||
<PackageReleaseNotes /> | |||
</PropertyGroup> | |||
<ItemGroup> | |||
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" /> | |||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\src\DotNetCore.CAP.Dashboard\DotNetCore.CAP.Dashboard.csproj" /> | |||
<ProjectReference Include="..\src\DotNetCore.CAP.RabbitMQ\DotNetCore.CAP.RabbitMQ.csproj" /> | |||
<ProjectReference Include="..\src\DotNetCore.CAP.SqlServer\DotNetCore.CAP.SqlServer.csproj" /> | |||
<ProjectReference Include="..\src\DotNetCore.CAP\DotNetCore.CAP.csproj" /> | |||
</ItemGroup> | |||
</Project> |
@@ -0,0 +1,25 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> | |||
<PropertyGroup> | |||
<TargetFramework>net6.0</TargetFramework> | |||
<ImplicitUsings>enable</ImplicitUsings> | |||
<Nullable>enable</Nullable> | |||
</PropertyGroup> | |||
<ItemGroup> | |||
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" /> | |||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" /> | |||
<PackageReference Include="Nuget.Tools.V2" Version="1.1.7"> | |||
<PrivateAssets>all</PrivateAssets> | |||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | |||
</PackageReference> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\src\DotNetCore.CAP.Dashboard\DotNetCore.CAP.Dashboard.csproj" /> | |||
<ProjectReference Include="..\src\DotNetCore.CAP.RabbitMQ\DotNetCore.CAP.RabbitMQ.csproj" /> | |||
<ProjectReference Include="..\src\DotNetCore.CAP.SqlServer\DotNetCore.CAP.SqlServer.csproj" /> | |||
<ProjectReference Include="..\src\DotNetCore.CAP\DotNetCore.CAP.csproj" /> | |||
</ItemGroup> | |||
</Project> |
@@ -0,0 +1,75 @@ | |||
| |||
using BPA.CAP.Settings; | |||
using DotNetCore.CAP; | |||
using Microsoft.Extensions.Configuration; | |||
using Microsoft.Extensions.DependencyInjection; | |||
using Newtonsoft.Json; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Text.Encodings.Web; | |||
using System.Text.Unicode; | |||
using System.Threading.Tasks; | |||
namespace BAP.CAP | |||
{ | |||
/// <summary> | |||
/// CAP扩展 | |||
/// </summary> | |||
public static class CapExtensions | |||
{ | |||
public static IServiceCollection AddCapConfiguration(this IServiceCollection services, IConfiguration configuration, CapSettings capSettings=null) | |||
{ | |||
RabbitmqSettings rabbitmqSettings = new RabbitmqSettings(); | |||
rabbitmqSettings= JsonConvert.DeserializeObject<RabbitmqSettings>(configuration.GetSection("rabbitmq_config").Value); | |||
if(capSettings==null) capSettings = new CapSettings(); | |||
var dbConfig= configuration.GetSection("sqlserver_config").Value; | |||
services.AddCap(x => { | |||
x.UseSqlServer(configuration.GetSection("sqlserver_config").Value); | |||
x.UseRabbitMQ(options => | |||
{ | |||
options.HostName = rabbitmqSettings.HostName;// "10.2.1.21"; | |||
options.UserName = rabbitmqSettings.UserName;// "guest"; | |||
options.Password = rabbitmqSettings.Password;// "guest"; | |||
}); | |||
x.UseDashboard(); | |||
x.FailedRetryCount = 5; | |||
x.FailedThresholdCallback+= capSettings.FailedThresholdCallback; | |||
x.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All); | |||
}); | |||
services.AddSingleton(capSettings); | |||
// db.ScopedContext | |||
//, db => | |||
// { | |||
// //(A)全局生效配置点 | |||
// //调试SQL事件,可以删掉 | |||
// db.Aop.OnLogExecuting = (sql, pars) => | |||
// { | |||
// Console.WriteLine(sql);//输出sql,查看执行sql | |||
// }; | |||
// } | |||
// ApolloClientSettings metaServerSettings = new ApolloClientSettings(); | |||
// builder.Configuration.GetSection(nameof(ApolloClientSettings)).Bind(metaServerSettings); | |||
// services.AddSingleton(metaServerSettings); | |||
//#pragma warning disable CS8601 // 引用类型赋值可能为 null。 | |||
//#pragma warning disable CS8604 // 引用类型参数可能为 null。 | |||
// var apollo = builder.Configuration.AddApollo(new ApolloOptions | |||
// { | |||
// AppId = metaServerSettings.AppId, | |||
// MetaServer = metaServerSettings.Host + ":" + metaServerSettings.Port, | |||
// Env = metaServerSettings.Env, | |||
// }).AddNamespace(metaServerSettings.CommonNameSpace).AddNamespace(metaServerSettings.ClientNameSpace); | |||
//#pragma warning restore CS8604 // 引用类型参数可能为 null。 | |||
//#pragma warning restore CS8601 // 引用类型赋值可能为 null。 | |||
return services; | |||
} | |||
} | |||
} |
@@ -0,0 +1,18 @@ | |||
using DotNetCore.CAP.Messages; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.CAP.Settings | |||
{ | |||
/// <summary> | |||
/// cap配置 | |||
/// </summary> | |||
public class CapSettings | |||
{ | |||
public Action<FailedInfo>? FailedThresholdCallback { get; set; } | |||
} | |||
} |
@@ -0,0 +1,27 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.CAP.Settings | |||
{ | |||
public class RabbitmqSettings | |||
{ | |||
/// <summary> | |||
/// The host to connect to. | |||
/// If you want connect to the cluster, you can assign like “192.168.1.111,192.168.1.112” | |||
/// </summary> | |||
public string HostName { get; set; } | |||
/// <summary> | |||
/// Password to use when authenticating to the server. | |||
/// </summary> | |||
public string Password { get; set; } | |||
/// <summary> | |||
/// Username to use when authenticating to the server. | |||
/// </summary> | |||
public string UserName { get; set; } | |||
} | |||
} |
@@ -86,7 +86,17 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.RabbitMQ.SqlServer.D | |||
EndProject | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetCore.CAP.OpenTelemetry", "src\DotNetCore.CAP.OpenTelemetry\DotNetCore.CAP.OpenTelemetry.csproj", "{83DDB126-A00B-4064-86E7-568322CA67EC}" | |||
EndProject | |||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample.AzureServiceBus.InMemory", "samples\Sample.AzureServiceBus.InMemory\Sample.AzureServiceBus.InMemory.csproj", "{0C734FB2-7D75-4FF3-B564-1E50E6280B14}" | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.AzureServiceBus.InMemory", "samples\Sample.AzureServiceBus.InMemory\Sample.AzureServiceBus.InMemory.csproj", "{0C734FB2-7D75-4FF3-B564-1E50E6280B14}" | |||
EndProject | |||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "bpa", "bpa", "{DF0DD539-DC9F-45F2-9A40-2FEAECCA8A32}" | |||
EndProject | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BAP.Cap.Sqlsugar", "BAP.Cap.Sqlsugar\BAP.Cap.Sqlsugar.csproj", "{68033006-2247-4F29-9734-3C243D176B90}" | |||
EndProject | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BAP.Cap.Sqlsugar.Demo1", "BAP.Cap.Sqlsugar.Demo1\BAP.Cap.Sqlsugar.Demo1.csproj", "{9DB77AD7-1704-420B-891E-56D208B18C2F}" | |||
EndProject | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BAP.Cap.Sqlsugar.Demo2", "BAP.Cap.Sqlsugar.Demo2\BAP.Cap.Sqlsugar.Demo2.csproj", "{89D860D2-7021-4E61-983A-9731A67FD948}" | |||
EndProject | |||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPA.CAP", "BPA.CAP\BPA.CAP.csproj", "{B980C896-4CA9-4AC4-AFED-5A8D752FB005}" | |||
EndProject | |||
Global | |||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | |||
@@ -214,6 +224,22 @@ Global | |||
{0C734FB2-7D75-4FF3-B564-1E50E6280B14}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||
{0C734FB2-7D75-4FF3-B564-1E50E6280B14}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||
{0C734FB2-7D75-4FF3-B564-1E50E6280B14}.Release|Any CPU.Build.0 = Release|Any CPU | |||
{68033006-2247-4F29-9734-3C243D176B90}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||
{68033006-2247-4F29-9734-3C243D176B90}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||
{68033006-2247-4F29-9734-3C243D176B90}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||
{68033006-2247-4F29-9734-3C243D176B90}.Release|Any CPU.Build.0 = Release|Any CPU | |||
{9DB77AD7-1704-420B-891E-56D208B18C2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||
{9DB77AD7-1704-420B-891E-56D208B18C2F}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||
{9DB77AD7-1704-420B-891E-56D208B18C2F}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||
{9DB77AD7-1704-420B-891E-56D208B18C2F}.Release|Any CPU.Build.0 = Release|Any CPU | |||
{89D860D2-7021-4E61-983A-9731A67FD948}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||
{89D860D2-7021-4E61-983A-9731A67FD948}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||
{89D860D2-7021-4E61-983A-9731A67FD948}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||
{89D860D2-7021-4E61-983A-9731A67FD948}.Release|Any CPU.Build.0 = Release|Any CPU | |||
{B980C896-4CA9-4AC4-AFED-5A8D752FB005}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||
{B980C896-4CA9-4AC4-AFED-5A8D752FB005}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||
{B980C896-4CA9-4AC4-AFED-5A8D752FB005}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||
{B980C896-4CA9-4AC4-AFED-5A8D752FB005}.Release|Any CPU.Build.0 = Release|Any CPU | |||
EndGlobalSection | |||
GlobalSection(SolutionProperties) = preSolution | |||
HideSolutionNode = FALSE | |||
@@ -249,6 +275,10 @@ Global | |||
{DCDF58E8-F823-4F04-9F8C-E8076DC16A68} = {3A6B6931-A123-477A-9469-8B468B5385AF} | |||
{83DDB126-A00B-4064-86E7-568322CA67EC} = {9B2AE124-6636-4DE9-83A3-70360DABD0C4} | |||
{0C734FB2-7D75-4FF3-B564-1E50E6280B14} = {3A6B6931-A123-477A-9469-8B468B5385AF} | |||
{68033006-2247-4F29-9734-3C243D176B90} = {DF0DD539-DC9F-45F2-9A40-2FEAECCA8A32} | |||
{9DB77AD7-1704-420B-891E-56D208B18C2F} = {DF0DD539-DC9F-45F2-9A40-2FEAECCA8A32} | |||
{89D860D2-7021-4E61-983A-9731A67FD948} = {DF0DD539-DC9F-45F2-9A40-2FEAECCA8A32} | |||
{B980C896-4CA9-4AC4-AFED-5A8D752FB005} = {DF0DD539-DC9F-45F2-9A40-2FEAECCA8A32} | |||
EndGlobalSection | |||
GlobalSection(ExtensibilityGlobals) = postSolution | |||
SolutionGuid = {2E70565D-94CF-40B4-BFE1-AC18D5F736AB} | |||
@@ -14,7 +14,12 @@ namespace Sample.RabbitMQ.MySql | |||
services.AddCap(x => | |||
{ | |||
x.UseEntityFramework<AppDbContext>(); | |||
x.UseRabbitMQ("localhost"); | |||
x.UseRabbitMQ(options => | |||
{ | |||
options.HostName = "10.2.1.21"; | |||
options.UserName = "guest"; | |||
options.Password = "guest"; | |||
}); | |||
x.UseDashboard(); | |||
x.FailedRetryCount = 5; | |||
x.FailedThresholdCallback = failed => | |||