From cb3a84abdbba63f2fb083bbdb53e772e6cf37263 Mon Sep 17 00:00:00 2001 From: liuhai Date: Fri, 25 Apr 2025 10:14:16 +0800 Subject: [PATCH 1/3] update ignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c599bb4..240f48b 100644 --- a/.gitignore +++ b/.gitignore @@ -399,4 +399,4 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml -/src/WebApplicationSample/appsettings.Local.json +appsettings.Local.json -- Gitee From 422a37dbabcd0fb990cf8264e5bf273534d1ef43 Mon Sep 17 00:00:00 2001 From: liuhai Date: Fri, 25 Apr 2025 10:16:20 +0800 Subject: [PATCH 2/3] update README --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9d1d7bb..d8c66fd 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,8 @@ 安装 https://www.nuget.org/packages/NebulaBus/ ``` -dotnet add package NebulaBus - +dotnet add package NebulaBus.Store.Redis +dotnet add package NebulaBus.Transport.Rabbitmq ``` 注入 @@ -48,7 +48,7 @@ builder.Services.AddNebulaBus(options => { options.ClusterName = "TestCluster"; options.UseRedisStore("localhost:6379,password=****,defaultDatabase=0,prefix=prefix_"); - options.UseRabbitmq(rabbitmq => + options.UseRabbitmqTransport(rabbitmq => { rabbitmq.HostName = “localhost”; rabbitmq.UserName = “guest”; -- Gitee From fd07bf6551b70e0af834e2dfa0be4b69e7cc0451 Mon Sep 17 00:00:00 2001 From: liuhai Date: Fri, 25 Apr 2025 12:02:32 +0800 Subject: [PATCH 3/3] Support Sql Store --- .github/workflows/release.yaml | 1 + README.md | 1 + src/NebulaBus.Store.Sql/LockEntity.cs | 10 ++ .../NebulaBus.Store.Sql.csproj | 28 ++++++ .../NebulaSqlStoreExtension.cs | 14 +++ .../NebulaSqlStoreServiceProvider.cs | 23 +++++ src/NebulaBus.Store.Sql/SqlStore.cs | 98 +++++++++++++++++++ src/NebulaBus.Store.Sql/StoreEntity.cs | 14 +++ src/NebulaBus.sln | 13 +++ .../Scheduler/DelayMessageScheduler.cs | 2 + src/NebulaBus/Store/IStore.cs | 2 + src/NebulaBus/Store/NebulaStoreMessage.cs | 4 +- .../Program.cs | 2 +- .../Program.cs | 61 ++++++++++++ .../Properties/launchSettings.json | 15 +++ .../RabbitmqWithSqlStoreWebApiSample.csproj | 20 ++++ .../appsettings.Development.json | 8 ++ .../appsettings.json | 9 ++ 18 files changed, 321 insertions(+), 4 deletions(-) create mode 100644 src/NebulaBus.Store.Sql/LockEntity.cs create mode 100644 src/NebulaBus.Store.Sql/NebulaBus.Store.Sql.csproj create mode 100644 src/NebulaBus.Store.Sql/NebulaSqlStoreExtension.cs create mode 100644 src/NebulaBus.Store.Sql/NebulaSqlStoreServiceProvider.cs create mode 100644 src/NebulaBus.Store.Sql/SqlStore.cs create mode 100644 src/NebulaBus.Store.Sql/StoreEntity.cs create mode 100644 src/RabbitmqWithSqlStoreWebApiSample/Program.cs create mode 100644 src/RabbitmqWithSqlStoreWebApiSample/Properties/launchSettings.json create mode 100644 src/RabbitmqWithSqlStoreWebApiSample/RabbitmqWithSqlStoreWebApiSample.csproj create mode 100644 src/RabbitmqWithSqlStoreWebApiSample/appsettings.Development.json create mode 100644 src/RabbitmqWithSqlStoreWebApiSample/appsettings.json diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a94f414..f92cd75 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -38,6 +38,7 @@ jobs: dotnet pack src/NebulaBus/NebulaBus.csproj /p:FileVersion=${{ steps.gitversion.outputs.version }} /p:Version=${{ steps.gitversion.outputs.version }} -p:PackageVersion=${{ steps.gitversion.outputs.version }} --output nupkgs dotnet pack src/NebulaBus.Store.Memory/NebulaBus.Store.Memory.csproj /p:FileVersion=${{ steps.gitversion.outputs.version }} /p:Version=${{ steps.gitversion.outputs.version }} -p:PackageVersion=${{ steps.gitversion.outputs.version }} --output nupkgs dotnet pack src/NebulaBus.Store.Redis/NebulaBus.Store.Redis.csproj /p:FileVersion=${{ steps.gitversion.outputs.version }} /p:Version=${{ steps.gitversion.outputs.version }} -p:PackageVersion=${{ steps.gitversion.outputs.version }} --output nupkgs + dotnet pack src/NebulaBus.Store.Sql/NebulaBus.Store.Sql.csproj /p:FileVersion=${{ steps.gitversion.outputs.version }} /p:Version=${{ steps.gitversion.outputs.version }} -p:PackageVersion=${{ steps.gitversion.outputs.version }} --output nupkgs dotnet pack src/NebulaBus.Transport.Memory/NebulaBus.Transport.Memory.csproj /p:FileVersion=${{ steps.gitversion.outputs.version }} /p:Version=${{ steps.gitversion.outputs.version }} -p:PackageVersion=${{ steps.gitversion.outputs.version }} --output nupkgs dotnet pack src/NebulaBus.Transport.Rabbitmq/NebulaBus.Transport.Rabbitmq.csproj /p:FileVersion=${{ steps.gitversion.outputs.version }} /p:Version=${{ steps.gitversion.outputs.version }} -p:PackageVersion=${{ steps.gitversion.outputs.version }} --output nupkgs diff --git a/README.md b/README.md index d8c66fd..c6b11ae 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ | ![NuGet Version](https://img.shields.io/nuget/v/NebulaBus?style=plastic&label=NebulaBus&color=blue&link=https%3A%2F%2Fwww.nuget.org%2Fpackages%2FNebulaBus%2F) | NebulaBus's Core | | ![NuGet Version](https://img.shields.io/nuget/v/NebulaBus.Store.Memory?style=plastic&label=NebulaBus.Store.Memory&color=blue&link=https%3A%2F%2Fwww.nuget.org%2Fpackages%2FNebulaBus.Store.Memory%2F) | NebulaBus Memory Store Provider | | ![NuGet Version](https://img.shields.io/nuget/v/NebulaBus.Store.Redis?style=plastic&label=NebulaBus.Store.Redis&color=blue&link=https%3A%2F%2Fwww.nuget.org%2Fpackages%2FNebulaBus.Store.Redis%2F) | NebulaBus Redis Store Provider | +| ![NuGet Version](https://img.shields.io/nuget/v/NebulaBus.Store.Sql?style=plastic&label=NebulaBus.Store.Sql&color=blue&link=https%3A%2F%2Fwww.nuget.org%2Fpackages%2FNebulaBus.Store.Sql%2F) | NebulaBus Sql Store Provider | | ![NuGet Version](https://img.shields.io/nuget/v/NebulaBus.Transport.Memory?style=plastic&label=NebulaBus.Transport.Memory&color=blue&link=https%3A%2F%2Fwww.nuget.org%2Fpackages%2FNebulaBus.Transport.Memory%2F) | NebulaBus Memory Transport Provider | | ![NuGet Version](https://img.shields.io/nuget/v/NebulaBus.Transport.Rabbitmq?style=plastic&label=NebulaBus.Transport.Rabbitmq&color=blue&link=https%3A%2F%2Fwww.nuget.org%2Fpackages%2FNebulaBus.Transport.Rabbitmq%2F) | NebulaBus Rabbitmq Transport Provider | diff --git a/src/NebulaBus.Store.Sql/LockEntity.cs b/src/NebulaBus.Store.Sql/LockEntity.cs new file mode 100644 index 0000000..c0cb3f9 --- /dev/null +++ b/src/NebulaBus.Store.Sql/LockEntity.cs @@ -0,0 +1,10 @@ +namespace NebulaBus.Store.Sql +{ + internal class LockEntity + { + [SqlSugar.SugarColumn(IsPrimaryKey = true)] + public string Id { get; set; } + public string Value { get; set; } + public long ExpireTime { get; set; } + } +} diff --git a/src/NebulaBus.Store.Sql/NebulaBus.Store.Sql.csproj b/src/NebulaBus.Store.Sql/NebulaBus.Store.Sql.csproj new file mode 100644 index 0000000..cbf6461 --- /dev/null +++ b/src/NebulaBus.Store.Sql/NebulaBus.Store.Sql.csproj @@ -0,0 +1,28 @@ + + + javen liu + JiewitTech + https://github.com/JiewitTech/NebulaBus.git + https://github.com/JiewitTech/NebulaBus + NebulaBus - Future oriented NET distributed event bus framework, allowing developers to focus on development + NebulaBus enventbus Bus Event Publish + MIT + README.md + $(PackageVersion) + + + + netstandard2.1 + enable + + + + + + + + + + + + diff --git a/src/NebulaBus.Store.Sql/NebulaSqlStoreExtension.cs b/src/NebulaBus.Store.Sql/NebulaSqlStoreExtension.cs new file mode 100644 index 0000000..578f41d --- /dev/null +++ b/src/NebulaBus.Store.Sql/NebulaSqlStoreExtension.cs @@ -0,0 +1,14 @@ +using NebulaBus; +using NebulaBus.Store.Sql; +using SqlSugar; + +namespace Microsoft.Extensions.DependencyInjection +{ + public static class NebulaSqlStoreExtension + { + public static void UseSqlStore(this NebulaOptions options, ConnectionConfig connectionConfig) + { + options.AddNebulaServiceProvider(new NebulaSqlStoreServiceProvider(connectionConfig)); + } + } +} diff --git a/src/NebulaBus.Store.Sql/NebulaSqlStoreServiceProvider.cs b/src/NebulaBus.Store.Sql/NebulaSqlStoreServiceProvider.cs new file mode 100644 index 0000000..00b65cf --- /dev/null +++ b/src/NebulaBus.Store.Sql/NebulaSqlStoreServiceProvider.cs @@ -0,0 +1,23 @@ +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection.Extensions; +using SqlSugar; + +namespace NebulaBus.Store.Sql +{ + internal class NebulaSqlStoreServiceProvider : INebulaServiceProvider + { + private readonly ConnectionConfig _connectionConfig; + + public NebulaSqlStoreServiceProvider(ConnectionConfig connectionConfig) + { + _connectionConfig = connectionConfig; + } + + public void ProvideServices(IServiceCollection services, NebulaOptions options) + { + _connectionConfig.IsAutoCloseConnection = true; + services.AddKeyedSingleton("NebulaBusSqlClient", new SqlSugarScope(_connectionConfig)); + services.TryAddSingleton(); + } + } +} diff --git a/src/NebulaBus.Store.Sql/SqlStore.cs b/src/NebulaBus.Store.Sql/SqlStore.cs new file mode 100644 index 0000000..4c8ec73 --- /dev/null +++ b/src/NebulaBus.Store.Sql/SqlStore.cs @@ -0,0 +1,98 @@ +using Microsoft.Extensions.DependencyInjection; +using SqlSugar; +using System; +using System.Linq; +using System.Text.Json; +using System.Threading.Tasks; + +namespace NebulaBus.Store.Sql +{ + internal class SqlStore : IStore + { + private string LockKey => $"NebulaBus:{_nebulaOptions.ClusterName}.Lock"; + private readonly SqlSugarScope _sqlClient; + private readonly JsonSerializerOptions _jsonSerializerOptions; + private readonly NebulaOptions _nebulaOptions; + public SqlStore(IServiceProvider serviceProvider, NebulaOptions nebulaOptions) + { + _sqlClient = serviceProvider.GetRequiredKeyedService("NebulaBusSqlClient"); + _jsonSerializerOptions = nebulaOptions.JsonSerializerOptions; + _nebulaOptions = nebulaOptions; + } + + public void Add(NebulaStoreMessage nebulaStoreMessage) + { + _sqlClient.Insertable(new StoreEntity() + { + Id = nebulaStoreMessage.GetKey(), + Content = JsonSerializer.Serialize(nebulaStoreMessage, _jsonSerializerOptions), + TimeStamp = nebulaStoreMessage.TriggerTime + }).ExecuteCommand(); + } + + public void Delete(NebulaStoreMessage nebulaStoreMessage) + { + _sqlClient.Deleteable().Where(x => x.Id == nebulaStoreMessage.GetKey()).ExecuteCommand(); + } + + public void Dispose() + { + _sqlClient?.Dispose(); + } + + public async Task Get(long beforeTimestamp) + { + var entities = await _sqlClient.Queryable().Where(x => x.TimeStamp <= beforeTimestamp).ToListAsync(); + if (entities == null) return null; + var result = entities.Select(x => JsonSerializer.Deserialize(x.Content, _jsonSerializerOptions)).ToArray(); + return result!; + } + + public bool Lock(string value) + { + try + { + var now = DateTimeOffset.Now.ToUnixTimeSeconds(); + var x = _sqlClient.Storageable(new LockEntity() + { + Id = LockKey, + Value = value, + ExpireTime = now + 3 + }).ToStorage(); + + //不存在插入表示拿到锁 + var result = x.AsInsertable.ExecuteCommand(); + if (result == 1) return true; + + //存在但锁过期,更新锁并拿到锁 + result = x.AsUpdateable.Where(x => x.Id == LockKey && x.ExpireTime < now).ExecuteCommand(); + if (result == 1) return true; + return false; + } + catch + { + return false; + } + } + + public void RefreshLock() + { + var expire = DateTimeOffset.Now.ToUnixTimeSeconds() + 3; + _sqlClient.Updateable().Where(x => x.Id == LockKey).SetColumns(x => new LockEntity() + { + ExpireTime = expire + }).ExecuteCommand(); + } + + public void UnLock(string value) + { + _sqlClient.Deleteable().Where(x => x.Id == LockKey && x.Value == value).ExecuteCommand(); + } + + public void Init() + { + _sqlClient.CodeFirst.InitTables(typeof(LockEntity)); + _sqlClient.CodeFirst.InitTables(typeof(StoreEntity)); + } + } +} diff --git a/src/NebulaBus.Store.Sql/StoreEntity.cs b/src/NebulaBus.Store.Sql/StoreEntity.cs new file mode 100644 index 0000000..aa986f6 --- /dev/null +++ b/src/NebulaBus.Store.Sql/StoreEntity.cs @@ -0,0 +1,14 @@ +using SqlSugar; + +namespace NebulaBus.Store.Sql +{ + [SugarIndex("index_timestamp", nameof(TimeStamp), OrderByType.Asc)] + internal class StoreEntity + { + [SugarColumn(IsPrimaryKey = true)] + public string Id { get; set; } + [SugarColumn(ColumnDataType = "longtext")] + public string Content { get; set; } + public long TimeStamp { get; set; } + } +} \ No newline at end of file diff --git a/src/NebulaBus.sln b/src/NebulaBus.sln index 036f078..a223c9e 100644 --- a/src/NebulaBus.sln +++ b/src/NebulaBus.sln @@ -27,6 +27,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LogicSamples", "LogicSample EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RabbitmqWithRedisStoreWebApiSample", "RabbitmqWithRedisStoreWebApiSample\RabbitmqWithRedisStoreWebApiSample.csproj", "{821FE282-43EE-480D-B395-547A8813EB25}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NebulaBus.Store.Sql", "NebulaBus.Store.Sql\NebulaBus.Store.Sql.csproj", "{4A4309BF-26C8-4BA6-9ADA-DD84FF8ADD61}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RabbitmqWithSqlStoreWebApiSample", "RabbitmqWithSqlStoreWebApiSample\RabbitmqWithSqlStoreWebApiSample.csproj", "{87A888DB-2E89-4205-B3A3-32F38CE946BF}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -77,6 +81,14 @@ Global {821FE282-43EE-480D-B395-547A8813EB25}.Debug|Any CPU.Build.0 = Debug|Any CPU {821FE282-43EE-480D-B395-547A8813EB25}.Release|Any CPU.ActiveCfg = Release|Any CPU {821FE282-43EE-480D-B395-547A8813EB25}.Release|Any CPU.Build.0 = Release|Any CPU + {4A4309BF-26C8-4BA6-9ADA-DD84FF8ADD61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4A4309BF-26C8-4BA6-9ADA-DD84FF8ADD61}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4A4309BF-26C8-4BA6-9ADA-DD84FF8ADD61}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4A4309BF-26C8-4BA6-9ADA-DD84FF8ADD61}.Release|Any CPU.Build.0 = Release|Any CPU + {87A888DB-2E89-4205-B3A3-32F38CE946BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {87A888DB-2E89-4205-B3A3-32F38CE946BF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {87A888DB-2E89-4205-B3A3-32F38CE946BF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {87A888DB-2E89-4205-B3A3-32F38CE946BF}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -87,6 +99,7 @@ Global {9CC09AB1-0589-4A44-895F-4F0F7CD17E2E} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} {43607D99-9A7F-4A8C-8539-07C1424022C7} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} {821FE282-43EE-480D-B395-547A8813EB25} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} + {87A888DB-2E89-4205-B3A3-32F38CE946BF} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {855D751D-7811-4D9B-87C9-F628E17E3A56} diff --git a/src/NebulaBus/Scheduler/DelayMessageScheduler.cs b/src/NebulaBus/Scheduler/DelayMessageScheduler.cs index b860145..27a06f2 100644 --- a/src/NebulaBus/Scheduler/DelayMessageScheduler.cs +++ b/src/NebulaBus/Scheduler/DelayMessageScheduler.cs @@ -48,6 +48,8 @@ namespace NebulaBus.Scheduler timer.Elapsed += Timer_Elapsed; var lockValue = Guid.NewGuid().ToString(); + _store.Init(); + cts.Token.Register(() => { _scheduler.Clear(); diff --git a/src/NebulaBus/Store/IStore.cs b/src/NebulaBus/Store/IStore.cs index 5db8f10..fcec420 100644 --- a/src/NebulaBus/Store/IStore.cs +++ b/src/NebulaBus/Store/IStore.cs @@ -11,5 +11,7 @@ namespace NebulaBus.Store void RefreshLock(); bool Lock(string value); void UnLock(string value); + void Init() + { } } } \ No newline at end of file diff --git a/src/NebulaBus/Store/NebulaStoreMessage.cs b/src/NebulaBus/Store/NebulaStoreMessage.cs index ef068bd..a6f8017 100644 --- a/src/NebulaBus/Store/NebulaStoreMessage.cs +++ b/src/NebulaBus/Store/NebulaStoreMessage.cs @@ -1,6 +1,4 @@ -using System; - -namespace NebulaBus.Store +namespace NebulaBus.Store { public class NebulaStoreMessage { diff --git a/src/RabbitmqWithRedisStoreWebApiSample/Program.cs b/src/RabbitmqWithRedisStoreWebApiSample/Program.cs index 2734e89..898800b 100644 --- a/src/RabbitmqWithRedisStoreWebApiSample/Program.cs +++ b/src/RabbitmqWithRedisStoreWebApiSample/Program.cs @@ -8,7 +8,7 @@ public class Program public static void Main(string[] args) { var builder = Microsoft.AspNetCore.Builder.WebApplication.CreateBuilder(args); - builder.WebHost.UseUrls("http://*:55896"); + builder.WebHost.UseUrls("http://*:0"); builder.Logging.AddConsole(); var environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); diff --git a/src/RabbitmqWithSqlStoreWebApiSample/Program.cs b/src/RabbitmqWithSqlStoreWebApiSample/Program.cs new file mode 100644 index 0000000..a30a85d --- /dev/null +++ b/src/RabbitmqWithSqlStoreWebApiSample/Program.cs @@ -0,0 +1,61 @@ +using LogicSamples; +using LogicSamples.Handlers; + +namespace RabbitmqWithRedisStoreWebApiSample; + +public class Program +{ + public static void Main(string[] args) + { + var builder = Microsoft.AspNetCore.Builder.WebApplication.CreateBuilder(args); + builder.WebHost.UseUrls("http://*:0"); + builder.Logging.AddConsole(); + var environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); + + builder.Configuration.SetBasePath(Directory.GetCurrentDirectory()) + .AddJsonFile("appsettings.json", false, reloadOnChange: true) + .AddJsonFile($"appsettings.{environment}.json", true, reloadOnChange: true); + var configuration = builder.Configuration; + + // Add services to the container. + builder.Services.AddControllers(); + // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle + builder.Services.AddEndpointsApiExplorer(); + builder.Services.AddSwaggerGen(); + builder.Services.AddNebulaBus(options => + { + options.ClusterName = "TestCluster"; + options.UseSqlStore(new SqlSugar.ConnectionConfig() + { + ConnectionString = configuration!.GetConnectionString("SqlConn"), + }); + options.UseRabbitmqTransport(rabbitmq => + { + rabbitmq.HostName = configuration!.GetValue("RabbitMq:HostName"); + rabbitmq.UserName = configuration!.GetValue("RabbitMq:UserName"); + rabbitmq.Password = configuration!.GetValue("RabbitMq:Password"); + rabbitmq.VirtualHost = configuration!.GetValue("RabbitMq:VirtualHost"); + }); + }); + builder.Services.AddNebulaBusHandler(typeof(TestHandlerV1).Assembly); + //builder.Services.AddNebulaBusHandler(); + //builder.Services.AddNebulaBusHandler(); + //Add Global Handler Filter + builder.Services.AddNebulaBusFilter(); + + var app = builder.Build(); + + // Configure the HTTP request pipeline. + if (app.Environment.IsDevelopment() || environment == "Local") + { + app.UseSwagger(); + app.UseSwaggerUI(); + } + + app.UseAuthorization(); + + app.MapControllers(); + + app.Run(); + } +} \ No newline at end of file diff --git a/src/RabbitmqWithSqlStoreWebApiSample/Properties/launchSettings.json b/src/RabbitmqWithSqlStoreWebApiSample/Properties/launchSettings.json new file mode 100644 index 0000000..b0f187f --- /dev/null +++ b/src/RabbitmqWithSqlStoreWebApiSample/Properties/launchSettings.json @@ -0,0 +1,15 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:5262", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Local" + } + } + } +} diff --git a/src/RabbitmqWithSqlStoreWebApiSample/RabbitmqWithSqlStoreWebApiSample.csproj b/src/RabbitmqWithSqlStoreWebApiSample/RabbitmqWithSqlStoreWebApiSample.csproj new file mode 100644 index 0000000..7ca634e --- /dev/null +++ b/src/RabbitmqWithSqlStoreWebApiSample/RabbitmqWithSqlStoreWebApiSample.csproj @@ -0,0 +1,20 @@ + + + + net8.0 + enable + enable + + + + + + + + + + + + + + diff --git a/src/RabbitmqWithSqlStoreWebApiSample/appsettings.Development.json b/src/RabbitmqWithSqlStoreWebApiSample/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/src/RabbitmqWithSqlStoreWebApiSample/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/src/RabbitmqWithSqlStoreWebApiSample/appsettings.json b/src/RabbitmqWithSqlStoreWebApiSample/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/src/RabbitmqWithSqlStoreWebApiSample/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} -- Gitee