Skip to content

Commit

Permalink
修正依赖
Browse files Browse the repository at this point in the history
  • Loading branch information
guoming committed Dec 23, 2021
1 parent 1e8dadb commit daa882b
Show file tree
Hide file tree
Showing 51 changed files with 232 additions and 271 deletions.
3 changes: 3 additions & 0 deletions ci-nuget-pack.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
find . -name "*.nupkg"|xargs rm -rf
dotnet pack --configuration Debug
find . -name "*.nupkg"|xargs -I {} dotnet nuget push "{}" --api-key oy2lf5bairpuqwucpxsa3w2f7hoj7txupek3prt4a2bi5u -s https://api.nuget.org/v3/index.json
Binary file added example/.DS_Store
Binary file not shown.
Binary file added example/Hummingbird.WebApi/.DS_Store
Binary file not shown.
30 changes: 14 additions & 16 deletions example/Hummingbird.WebApi/Config/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
},
"Database": {
"SQLServer": {
"Server": "192.168.10.227",
"Database": "zongteng_TMS-dev",
"UserId": "zt-2874-dev",
"Password": "qXSW!9vXYfFxQYbg"
"Server": "localhost",
"Database": "example",
"UserId": "sa",
"Password": "123456"
}
},
"AppMetrics": {
Expand All @@ -37,7 +37,7 @@
},
"Influxdb": {
"Enable": true,
"Address": "http://influxdb.service.consul:8086",
"Address": "http://localhost:8086",
"Database": "AppMetrics",
"UserName": "root",
"Password": "influxdb",
Expand All @@ -52,22 +52,22 @@
}
},
"EventBus": {
"HostName": "192.168.109.166,test.rabbitmq.service.consul",
"HostName": "localhost",
"Port": "5672",
"VirtualHost": "/LMS_TEST",
"UserName": "lms_portal_user",
"Password": "lms_portal_user@passw0rd"
"UserName": "guest",
"Password": "123456"
},
"Kafka": {
"Sender": {
"Debug": "broker,topic,msg",
"bootstrap.servers": "192.168.87.7:9092"
"bootstrap.servers": "localhost:9092"

},
"Receiver": {
"Debug": "consumer,cgrp,topic,fetch",
"GroupId": "dev1",
"bootstrap.servers": "192.168.87.7:9092"
"bootstrap.servers": "localhost:9092"
}
},
"Canal": {
Expand Down Expand Up @@ -105,15 +105,13 @@
}
]
},
"SERVICE_REGISTRY_ADDRESS": "192.168.109.127",
"SERVICE_REGISTRY_ADDRESS": "localhost",
"SERVICE_REGISTRY_PORT": "8500",
"SERVICE_SELF_REGISTER": true,
"SERVICE_NAME": "SERVICE_EXAMPLE",
"SERVICE_TAGS": "TEST",
"SERVICE_NAME": "example",
"SERVICE_TAGS": "test",
"SERVICE_REGION": "dc1",
//"SERVICE_80_CHECK_HTTP": "/healthcheck",
//"SERVICE_80_CHECK_INTERVAL": "15",
//"SERVICE_80_CHECK_TIMEOUT": "15",
"SERVICE_CHECK_HTTP": "/healthcheck",
"SERVICE_CHECK_TCP": null,
"SERVICE_CHECK_SCRIPT": null,
"SERVICE_CHECK_TTL": "15",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public CacheingTestController(

[HttpGet]
[Route("Test")]
public async Task<string> Test()
public string Test()
{
var cacheKey = "cacheKey";
var cacheValue = cacheManager.StringGet<string>(cacheKey);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,7 @@ public class OpenTracingTestController : Controller
{


[HttpGet]
[Route("Test")]
public async Task Test()
{
using (Hummingbird.Extensions.Tracing.Tracer tracer = new Hummingbird.Extensions.Tracing.Tracer("Test"))
{
tracer.SetTag("tag1", "value1");
tracer.SetError();
tracer.Log("key1", "value1");

}


}


}

Expand Down
Binary file added example/Hummingbird.WebApi/Events/.DS_Store
Binary file not shown.
5 changes: 2 additions & 3 deletions example/Hummingbird.WebApi/Hummingbird.Example.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath>
</PropertyGroup>

Expand All @@ -20,8 +20,7 @@

<ItemGroup>
<PackageReference Include="Autofac.Extras.DynamicProxy" Version="4.5.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.3" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
<!-- <PackageReference Include="Microsoft.AspNetCore.All" Version="2.2.0" />-->
</ItemGroup>

<ItemGroup>
Expand Down
11 changes: 3 additions & 8 deletions example/Hummingbird.WebApi/Program.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
using Hummingbird.AspNetCore.HealthChecks;
using System.IO;
using Hummingbird.AspNetCore.HealthChecks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using System.IO;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Hosting.Internal;
using Microsoft.Extensions.Logging;

namespace Hummingbird.Example
{
Expand All @@ -14,10 +13,6 @@ public class Program
public static void Main(string[] args)
{
BuildWebHost(args).Run();




}

public static IWebHost BuildWebHost(string[] args) =>
Expand Down
45 changes: 23 additions & 22 deletions example/Hummingbird.WebApi/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,30 @@ public Startup(IConfiguration configuration)
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddCors()
.AddMvc(a => a.EnableEndpointRouting = false)
.SetCompatibilityVersion(Microsoft.AspNetCore.Mvc.CompatibilityVersion.Version_3_0)
.AddControllersAsServices(); //全局配置Json序列化处理



services.AddHealthChecks(checks =>
{
checks.WithDefaultCacheDuration(TimeSpan.FromSeconds(5));
checks.AddMySqlCheck("mysql", "Server=dev.mysql.service.consul;Port=63307;Database=lms_openapi_cn_dev; User=lms-dev;Password=97bL8AtWmlfxQtK10Afg;pooling=True;minpoolsize=1;maxpoolsize=100;connectiontimeout=180;SslMode=None");
checks.AddSqlCheck("sqlserver", "Data Source=test.sqlserver.service.consul,63341;Initial Catalog=ZT_ConfigCenter_TEST;User Id=tms-test;Password=qtvf12Croexy4cXH7lZB");
checks.AddMySqlCheck("mysql", "Server=localhost;Port=3306;Database=example; User=root;Password=123456;pooling=True;minpoolsize=1;maxpoolsize=100;connectiontimeout=180;SslMode=None");
checks.AddRedisCheck("redis", Configuration["redis:0:connectionString"]);
checks.AddRabbitMQCheck("rabbitmq", factory =>
{
factory.WithEndPoint(Configuration["EventBus:HostName"] ?? "localhost", int.Parse(Configuration["EventBus:Port"] ?? "5672"));
factory.WithAuth(Configuration["EventBus:UserName"] ?? "guest", Configuration["EventBus:Password"] ?? "guest");
factory.WithExchange(Configuration["EventBus:VirtualHost"] ?? "/");
});
checks.AddKafkaCheck("kafka", new Confluent.Kafka.ProducerConfig()
{
Acks = Confluent.Kafka.Acks.All,
//BootstrapServers = "192.168.78.29:9092,192.168.78.30:9092,192.168.78.31:9092",
BootstrapServers = Configuration["Kafka:Sender:bootstrap.servers"]
});
//checks.AddRabbitMQCheck("rabbitmq", factory =>
//{
// factory.WithEndPoint(Configuration["EventBus:HostName"] ?? "localhost", int.Parse(Configuration["EventBus:Port"] ?? "5672"));
// factory.WithAuth(Configuration["EventBus:UserName"] ?? "guest", Configuration["EventBus:Password"] ?? "guest");
// factory.WithExchange(Configuration["EventBus:VirtualHost"] ?? "/");
//});
//checks.AddKafkaCheck("kafka", new Confluent.Kafka.ProducerConfig()
//{
// Acks = Confluent.Kafka.Acks.All,
// //BootstrapServers = "192.168.78.29:9092,192.168.78.30:9092,192.168.78.31:9092",
// BootstrapServers = Configuration["Kafka:Sender:bootstrap.servers"]
//});
});

services.AddHummingbird(hummingbird =>
Expand Down Expand Up @@ -175,7 +180,7 @@ public void ConfigureServices(IServiceCollection services)
}

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
var eventBus = app.ApplicationServices.GetRequiredService<IEventBus>();
var logger = app.ApplicationServices.GetRequiredService<ILogger<IEventLogger>>();
Expand All @@ -188,10 +193,8 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
sp.UseSubscriber(eventbus =>
{
eventbus.RegisterBatch<CanalEntryEvent, CanalEntryEventHandler > ("", "canal_dwh_test2");
eventbus.RegisterBatch<TestEvent, TestEventHandler1>("TestEventHandler", "TestEventHandler");
eventbus.RegisterBatch<Hummingbird.Example.Events.MongoShark.MongodbSharkEvent, Example.Events.MongoShark.MongodbSharkEventHandler>("", "mongodb_test.tmstracking.sync_order");


//订阅消息
eventbus.Subscribe((Messages) =>
{
Expand Down Expand Up @@ -223,9 +226,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
});

});
app.UseMvc();



}
}
}
41 changes: 0 additions & 41 deletions example/Test/Program.cs

This file was deleted.

11 changes: 0 additions & 11 deletions example/Test/Test.csproj

This file was deleted.

Binary file added src/Hummingbird.AspNet.HealthChecks/.DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net46</TargetFramework>
<Version>1.16.0</Version>
<TargetFrameworks>net46;</TargetFrameworks>
<Version>1.17.0</Version>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp1.0</TargetFramework>
<Version>1.16.0</Version>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>1.17.0</Version>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>1.16.0</Version>
<Version>1.17.0</Version>

<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageId>Hummingbird.AspNetCore.Metrics</PackageId>
Expand All @@ -17,7 +17,6 @@
<PackageReference Include="App.Metrics.Prometheus" Version="4.1.0" />
<PackageReference Include="App.Metrics.Reporting.Console" Version="4.1.0" />
<PackageReference Include="App.Metrics.Reporting.InfluxDB" Version="4.1.0" />
<PackageReference Include="DumpExtensions" Version="2.0.0" />
</ItemGroup>

</Project>
8 changes: 4 additions & 4 deletions src/Hummingbird.Core/Hummingbird.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;netstandard2.0</TargetFrameworks>
<Version>1.16.0</Version>
<TargetFrameworks>netcoreapp2.2;netstandard2.0</TargetFrameworks>
<Version>1.17.0</Version>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<RootNamespace>Hummingbird.Core</RootNamespace>
<Authors>guoming</Authors>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.2' ">
<DefineConstants>NETCORE</DefineConstants>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="1.0.2" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.2' ">
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.1.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>1.16.0</Version>
<Version>1.17.0</Version>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>guoming</Authors>
<Company>guoming</Company>
Expand Down
2 changes: 2 additions & 0 deletions src/Hummingbird.DynamicRoute/IServiceDiscoveryProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public interface IServiceDiscoveryProvider

void Deregister();

void Heartbeat();

string ServiceId { get; }
}
}
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;net4.6.1;</TargetFrameworks>
<TargetFrameworks>netcoreapp2.2;net4.6.1;</TargetFrameworks>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>1.16.0</Version>
<Version>1.17.0</Version>
<RepositoryUrl>https://github.com/guoming/Hummingbird</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Description>分布式缓存</Description>
<Authors>GUOMING</Authors>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.2' ">
<DefineConstants>NETCORE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net4.6.1' ">
<DefineConstants>NET461</DefineConstants>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.2' ">
<PackageReference Include="CacheManager.Core" Version="1.2.0" />
<PackageReference Include="CacheManager.Microsoft.Extensions.Caching.Memory" Version="1.2.0" />
<PackageReference Include="CacheManager.Microsoft.Extensions.Configuration" Version="1.2.0" />
Expand Down
Loading

0 comments on commit daa882b

Please sign in to comment.