Commit 5d1c1bfb authored by Savorboard's avatar Savorboard

Architectural refactoring

parent 47b1dc5c
...@@ -68,6 +68,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetCore.CAP.InMemoryStor ...@@ -68,6 +68,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetCore.CAP.InMemoryStor
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.AzureServiceBus.InMemory", "samples\Sample.AzureServiceBus.InMemory\Sample.AzureServiceBus.InMemory.csproj", "{1E1E959C-3D0E-45C3-ABCA-DAAACE68AAB8}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.AzureServiceBus.InMemory", "samples\Sample.AzureServiceBus.InMemory\Sample.AzureServiceBus.InMemory.csproj", "{1E1E959C-3D0E-45C3-ABCA-DAAACE68AAB8}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetCore.CAP.Dashboard", "src\DotNetCore.CAP.Dashboard\DotNetCore.CAP.Dashboard.csproj", "{56FB261C-67AF-4715-9A46-4FA4FAB91B2C}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
...@@ -142,6 +144,10 @@ Global ...@@ -142,6 +144,10 @@ Global
{1E1E959C-3D0E-45C3-ABCA-DAAACE68AAB8}.Debug|Any CPU.Build.0 = Debug|Any CPU {1E1E959C-3D0E-45C3-ABCA-DAAACE68AAB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1E1E959C-3D0E-45C3-ABCA-DAAACE68AAB8}.Release|Any CPU.ActiveCfg = Release|Any CPU {1E1E959C-3D0E-45C3-ABCA-DAAACE68AAB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1E1E959C-3D0E-45C3-ABCA-DAAACE68AAB8}.Release|Any CPU.Build.0 = Release|Any CPU {1E1E959C-3D0E-45C3-ABCA-DAAACE68AAB8}.Release|Any CPU.Build.0 = Release|Any CPU
{56FB261C-67AF-4715-9A46-4FA4FAB91B2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{56FB261C-67AF-4715-9A46-4FA4FAB91B2C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{56FB261C-67AF-4715-9A46-4FA4FAB91B2C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{56FB261C-67AF-4715-9A46-4FA4FAB91B2C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
...@@ -165,6 +171,7 @@ Global ...@@ -165,6 +171,7 @@ Global
{63B2A464-FBEA-42FB-8EFA-98AFA39FC920} = {9B2AE124-6636-4DE9-83A3-70360DABD0C4} {63B2A464-FBEA-42FB-8EFA-98AFA39FC920} = {9B2AE124-6636-4DE9-83A3-70360DABD0C4}
{58B6E829-C6C8-457C-9DD0-C600650254DF} = {9B2AE124-6636-4DE9-83A3-70360DABD0C4} {58B6E829-C6C8-457C-9DD0-C600650254DF} = {9B2AE124-6636-4DE9-83A3-70360DABD0C4}
{1E1E959C-3D0E-45C3-ABCA-DAAACE68AAB8} = {3A6B6931-A123-477A-9469-8B468B5385AF} {1E1E959C-3D0E-45C3-ABCA-DAAACE68AAB8} = {3A6B6931-A123-477A-9469-8B468B5385AF}
{56FB261C-67AF-4715-9A46-4FA4FAB91B2C} = {9B2AE124-6636-4DE9-83A3-70360DABD0C4}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2E70565D-94CF-40B4-BFE1-AC18D5F736AB} SolutionGuid = {2E70565D-94CF-40B4-BFE1-AC18D5F736AB}
......
...@@ -36,10 +36,10 @@ namespace Sample.RabbitMQ.MySql.Controllers ...@@ -36,10 +36,10 @@ namespace Sample.RabbitMQ.MySql.Controllers
//your business code //your business code
connection.Execute("insert into test(name) values('test')", transaction: (IDbTransaction)transaction.DbTransaction); connection.Execute("insert into test(name) values('test')", transaction: (IDbTransaction)transaction.DbTransaction);
for (int i = 0; i < 5; i++) //for (int i = 0; i < 5; i++)
{ //{
_capBus.Publish("sample.rabbitmq.mysql", DateTime.Now); _capBus.Publish("sample.rabbitmq.mysql", DateTime.Now);
} //}
transaction.Commit(); transaction.Commit();
} }
...@@ -68,10 +68,10 @@ namespace Sample.RabbitMQ.MySql.Controllers ...@@ -68,10 +68,10 @@ namespace Sample.RabbitMQ.MySql.Controllers
} }
[NonAction] [NonAction]
[CapSubscribe("#.rabbitmq.mysql")] [CapSubscribe("sample.rabbitmq.mysql")]
public void Subscriber(DateTime time) public void Subscriber(DateTime time)
{ {
Console.WriteLine($@"{DateTime.Now}, Subscriber invoked, Sent time:{time}"); //Console.WriteLine($@"{DateTime.Now}, Subscriber invoked, Sent time:{time}");
} }
} }
} }
...@@ -13,6 +13,7 @@ namespace Sample.RabbitMQ.MySql ...@@ -13,6 +13,7 @@ namespace Sample.RabbitMQ.MySql
public static IWebHost BuildWebHost(string[] args) => public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args) WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>() .UseStartup<Startup>()
.UseUrls("http://*:15173")
.Build(); .Build();
} }
} }
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
"launchBrowser": true, "launchBrowser": true,
"launchUrl": "cap", "launchUrl": "cap",
"environmentVariables": { "environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development" "ASPNETCORE_ENVIRONMENT": "Production"
}, },
"applicationUrl": "http://localhost:57173/" "applicationUrl": "http://localhost:57173/"
} }
......
...@@ -15,12 +15,13 @@ namespace Sample.RabbitMQ.MySql ...@@ -15,12 +15,13 @@ namespace Sample.RabbitMQ.MySql
services.AddCap(x => services.AddCap(x =>
{ {
x.UseEntityFramework<AppDbContext>(); x.UseEntityFramework<AppDbContext>();
x.UseRabbitMQ("localhost"); x.UseRabbitMQ("192.168.2.120");
x.UseDashboard(); x.UseDashboard();
x.FailedRetryCount = 5; x.FailedRetryCount = 5;
x.FailedThresholdCallback = (type, name, content) => x.FailedThresholdCallback = (type, name, content) =>
{ {
Console.WriteLine($@"A message of type {type} failed after executing {x.FailedRetryCount} several times, requiring manual troubleshooting. Message name: {name}, message body: {content}"); Console.WriteLine(
$@"A message of type {type} failed after executing {x.FailedRetryCount} several times, requiring manual troubleshooting. Message name: {name}, message body: {content}");
}; };
}); });
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"Logging": { "Logging": {
"IncludeScopes": false, "IncludeScopes": false,
"LogLevel": { "LogLevel": {
"Default": "Debug" "Default": "Error"
} }
} }
} }
...@@ -24,7 +24,7 @@ namespace DotNetCore.CAP ...@@ -24,7 +24,7 @@ namespace DotNetCore.CAP
services.Configure(_configure); services.Configure(_configure);
services.AddSingleton<IConsumerClientFactory, AzureServiceBusConsumerClientFactory>(); services.AddSingleton<IConsumerClientFactory, AzureServiceBusConsumerClientFactory>();
services.AddSingleton<IPublishExecutor, AzureServiceBusPublishMessageSender>(); services.AddSingleton<ITransportPublisher, AzureServiceBusPublishMessageSender>();
services.AddSingleton<IPublishMessageSender, AzureServiceBusPublishMessageSender>(); services.AddSingleton<IPublishMessageSender, AzureServiceBusPublishMessageSender>();
} }
} }
......
...@@ -19,7 +19,7 @@ namespace DotNetCore.CAP.Dashboard.Resources { ...@@ -19,7 +19,7 @@ namespace DotNetCore.CAP.Dashboard.Resources {
// class via a tool like ResGen or Visual Studio. // class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen // To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project. // with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class Strings { public class Strings {
......
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Content\css\bootstrap.min.css" />
<EmbeddedResource Include="Content\css\cap.css" />
<EmbeddedResource Include="Content\css\jsonview.min.css" />
<EmbeddedResource Include="Content\css\rickshaw.min.css" />
<EmbeddedResource Include="Content\fonts\glyphicons-halflings-regular.eot" />
<EmbeddedResource Include="Content\fonts\glyphicons-halflings-regular.svg" />
<EmbeddedResource Include="Content\fonts\glyphicons-halflings-regular.ttf" />
<EmbeddedResource Include="Content\fonts\glyphicons-halflings-regular.woff" />
<EmbeddedResource Include="Content\fonts\glyphicons-halflings-regular.woff2" />
<EmbeddedResource Include="Content\js\bootstrap.min.js" />
<EmbeddedResource Include="Content\js\cap.js" />
<EmbeddedResource Include="Content\js\d3.layout.min.js" />
<EmbeddedResource Include="Content\js\d3.min.js" />
<EmbeddedResource Include="Content\js\jquery-2.1.4.min.js" />
<EmbeddedResource Include="Content\js\jsonview.min.js" />
<EmbeddedResource Include="Content\js\moment-with-locales.min.js" />
<EmbeddedResource Include="Content\js\moment.min.js" />
<EmbeddedResource Include="Content\js\rickshaw.min.js" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DotNetCore.CAP\DotNetCore.CAP.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Update="Dashboard\Content\resx\Strings.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Strings.resx</DependentUpon>
</Compile>
<Compile Update="Dashboard\Pages\_SidebarMenu.generated.cs">
<DependentUpon>_SidebarMenu.cshtml</DependentUpon>
</Compile>
<Compile Update="Dashboard\Pages\SidebarMenu.cs">
<DependentUpon>_SidebarMenu.cshtml</DependentUpon>
</Compile>
<Compile Update="Dashboard\Pages\ReceivedPage.generated.cs">
<DependentUpon>ReceivedPage.cshtml</DependentUpon>
</Compile>
<Compile Update="Dashboard\Pages\ReceivedPage.cs">
<DependentUpon>ReceivedPage.cshtml</DependentUpon>
</Compile>
<Compile Update="Dashboard\Pages\_BlockMetric.generated.cs">
<DependentUpon>_BlockMetric.cshtml</DependentUpon>
</Compile>
<Compile Update="Dashboard\Pages\BlockMetric.cs">
<DependentUpon>_BlockMetric.cshtml</DependentUpon>
</Compile>
<Compile Update="Dashboard\Pages\Breadcrumbs.cs">
<DependentUpon>_Breadcrumbs.cshtml</DependentUpon>
</Compile>
<Compile Update="Dashboard\Pages\_Breadcrumbs.generated.cs">
<DependentUpon>_Breadcrumbs.cshtml</DependentUpon>
</Compile>
<Compile Update="Dashboard\Pages\_Paginator.generated.cs">
<DependentUpon>_Paginator.cshtml</DependentUpon>
</Compile>
<Compile Update="Dashboard\Pages\_Paginator.cs">
<DependentUpon>_Paginator.cshtml</DependentUpon>
</Compile>
<Compile Update="Dashboard\Pages\_PerPageSelector.cs">
<DependentUpon>_PerPageSelector.cshtml</DependentUpon>
</Compile>
<Compile Update="Dashboard\Pages\_PerPageSelector.generated.cs">
<DependentUpon>_PerPageSelector.cshtml</DependentUpon>
</Compile>
<Compile Update="Dashboard\Pages\PublishedPage.cs">
<DependentUpon>PublishedPage.cshtml</DependentUpon>
</Compile>
<Compile Update="Dashboard\Pages\PublishedPage*.cs">
<DependentUpon>PublishedPage.cshtml</DependentUpon>
</Compile>
<Compile Update="Dashboard\Pages\LayoutPage.*.cs">
<DependentUpon>LayoutPage.cshtml</DependentUpon>
</Compile>
<Compile Update="Dashboard\Pages\LayoutPage.cs">
<DependentUpon>LayoutPage.cshtml</DependentUpon>
</Compile>
<Compile Update="Dashboard\Pages\InlineMetric.cs">
<DependentUpon>_InlineMetric.cshtml</DependentUpon>
</Compile>
<Compile Update="Dashboard\Pages\_InlineMetric.generated.cs">
<DependentUpon>_InlineMetric.cshtml</DependentUpon>
</Compile>
<Compile Update="Dashboard\Pages\_Navigation.generated.cs">
<DependentUpon>_Navigation.cshtml</DependentUpon>
</Compile>
<Compile Update="Dashboard\Pages\HomePage.generated.cs">
<DependentUpon>HomePage.cshtml</DependentUpon>
</Compile>
<Compile Update="Dashboard\Pages\HomePage.cs">
<DependentUpon>HomePage.cshtml</DependentUpon>
</Compile>
<Compile Update="Dashboard\Pages\SubscriberPage.generated.cs">
<DependentUpon>SubscriberPage.cshtml</DependentUpon>
</Compile>
<Compile Update="Dashboard\Pages\NodePage*.cs">
<DependentUpon>NodePage.cshtml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Content\resx\Strings.resx">
<CustomToolNamespace>DotNetCore.CAP.Dashboard.Resources</CustomToolNamespace>
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
<Generator>PublicResXFileCodeGenerator</Generator>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Dashboard\Content\resx\Strings.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<CustomToolNamespace>DotNetCore.CAP.Dashboard.Resources</CustomToolNamespace>
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project>
...@@ -11,7 +11,7 @@ using System.Text.RegularExpressions; ...@@ -11,7 +11,7 @@ using System.Text.RegularExpressions;
using DotNetCore.CAP.Dashboard.Pages; using DotNetCore.CAP.Dashboard.Pages;
using DotNetCore.CAP.Dashboard.Resources; using DotNetCore.CAP.Dashboard.Resources;
using DotNetCore.CAP.Infrastructure; using DotNetCore.CAP.Infrastructure;
using DotNetCore.CAP.Models; using DotNetCore.CAP.Messages;
using Microsoft.Extensions.Internal; using Microsoft.Extensions.Internal;
namespace DotNetCore.CAP.Dashboard namespace DotNetCore.CAP.Dashboard
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using DotNetCore.CAP.Dashboard.Monitoring; using DotNetCore.CAP.Dashboard.Monitoring;
using DotNetCore.CAP.Models; using DotNetCore.CAP.Messages;
namespace DotNetCore.CAP.Dashboard namespace DotNetCore.CAP.Dashboard
{ {
......
// Copyright (c) .NET Core Community. All rights reserved. // Copyright (c) .NET Core Community. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information. // Licensed under the MIT License. See License.txt in the project root for license information.
using DotNetCore.CAP.Models; using DotNetCore.CAP.Messages;
namespace DotNetCore.CAP.Dashboard.Monitoring namespace DotNetCore.CAP.Dashboard.Monitoring
{ {
......
@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: True *@ @* Generator: Template TypeVisibility: Internal GeneratePrettyNames: True *@
@using DotNetCore.CAP.Dashboard.Pages @using DotNetCore.CAP.Dashboard.Pages
@using DotNetCore.CAP.Dashboard.Resources @using DotNetCore.CAP.Dashboard.Resources
@using DotNetCore.CAP.Models @using DotNetCore.CAP.Messages
@using Newtonsoft.Json @using Newtonsoft.Json
@inherits DotNetCore.CAP.Dashboard.RazorPage @inherits DotNetCore.CAP.Dashboard.RazorPage
@{ @{
......
#pragma warning disable 1591 using DotNetCore.CAP.Messages;
#pragma warning disable 1591
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
...@@ -45,8 +47,6 @@ namespace DotNetCore.CAP.Dashboard.Pages ...@@ -45,8 +47,6 @@ namespace DotNetCore.CAP.Dashboard.Pages
#line hidden #line hidden
#line 4 "..\..\HomePage.cshtml" #line 4 "..\..\HomePage.cshtml"
using DotNetCore.CAP.Models;
#line default #line default
#line hidden #line hidden
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
@using DotNetCore.CAP.Dashboard.Monitoring @using DotNetCore.CAP.Dashboard.Monitoring
@using DotNetCore.CAP.Dashboard.Pages @using DotNetCore.CAP.Dashboard.Pages
@using DotNetCore.CAP.Dashboard.Resources @using DotNetCore.CAP.Dashboard.Resources
@using DotNetCore.CAP.Models @using DotNetCore.CAP.Messages
@inherits DotNetCore.CAP.Dashboard.RazorPage @inherits DotNetCore.CAP.Dashboard.RazorPage
@{ @{
Layout = new LayoutPage(Strings.PublishedMessagesPage_Title); Layout = new LayoutPage(Strings.PublishedMessagesPage_Title);
......
#pragma warning disable 1591 using DotNetCore.CAP.Messages;
#pragma warning disable 1591
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
...@@ -46,7 +48,6 @@ namespace DotNetCore.CAP.Dashboard.Pages ...@@ -46,7 +48,6 @@ namespace DotNetCore.CAP.Dashboard.Pages
#line hidden #line hidden
#line 3 "..\..\PublishedPage.cshtml" #line 3 "..\..\PublishedPage.cshtml"
using DotNetCore.CAP.Models;
#line default #line default
#line hidden #line hidden
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
@using DotNetCore.CAP.Dashboard.Monitoring @using DotNetCore.CAP.Dashboard.Monitoring
@using DotNetCore.CAP.Dashboard.Pages @using DotNetCore.CAP.Dashboard.Pages
@using DotNetCore.CAP.Dashboard.Resources @using DotNetCore.CAP.Dashboard.Resources
@using DotNetCore.CAP.Models @using DotNetCore.CAP.Messages
@inherits DotNetCore.CAP.Dashboard.RazorPage @inherits DotNetCore.CAP.Dashboard.RazorPage
@{ @{
Layout = new LayoutPage(Strings.ReceivedMessagesPage_Title); Layout = new LayoutPage(Strings.ReceivedMessagesPage_Title);
......
#pragma warning disable 1591 using DotNetCore.CAP.Messages;
#pragma warning disable 1591
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
...@@ -46,7 +48,6 @@ namespace DotNetCore.CAP.Dashboard.Pages ...@@ -46,7 +48,6 @@ namespace DotNetCore.CAP.Dashboard.Pages
#line hidden #line hidden
#line 3 "..\..\ReceivedPage.cshtml" #line 3 "..\..\ReceivedPage.cshtml"
using DotNetCore.CAP.Models;
#line default #line default
#line hidden #line hidden
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment