Skip to content

Commit fb6943e

Browse files
release 2.4.2 (#272)
* update version to 2.4.0 * Add version options to config file. * update resource * add message version support for dashboard * add message version support for dashboard * Support using version to isolate messages. #220 * update mongo unit tests * update unit tests * update unit tests * Set default versions for consumer groups * solve the problem of issue#181 (#237) * Issue#235 (#238) * solve the problem of issue#181 * solve the problem of issue#235 * refactor * Fix the message persistence bug. #240 * using new CamelCaseNamingStrategy * update packages to .net core 2.2 * update test framework to netcoreapp2.2 * Update .travis.yml * update TargetFramework * Exclude build samples project * update version to 2.4.1 * add samples project to sln for build * update version to 2.4.2 * Fixed PostgreSql version isolation feature bug. (#256) * Fixed spelling errors * modify cap publish Message to rabbitmq slow (#261) * Startup the CAP with the BackgroundService. #265 * update samples * Fixed SQL query bug. #266 * update travis ci config * update travis ci config * adjust dashboard table column width * adjust the consumer execution time to milliseconds
1 parent 94e54c2 commit fb6943e

21 files changed

+81
-101
lines changed

.travis.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
language: csharp
22
sudo: required
3-
dist: trusty
3+
dist: xenial
44
solution: CAP.sln
5-
dotnet: 2.2.100
5+
dotnet: 2.2
66
mono: none
77

8-
matrix:
9-
include:
10-
- os: linux
11-
dist: trusty # Ubuntu 14.04
12-
sudo: required
13-
- os: osx
14-
osx_image: xcode8.3 # macOS 10.12
8+
#matrix:
9+
# include:
10+
# - dotnet: 2.2
11+
# - os: linux
12+
# dist: trusty # Ubuntu 14.04
13+
# sudo: required
14+
# - os: osx
15+
# osx_image: xcode8.3 # macOS 10.12
1516

1617
# Run the build script
1718
script:
1819
- dotnet --info
1920
- dotnet restore CAP.sln
2021
- dotnet build CAP.sln
21-
- dotnet test test/DotNetCore.CAP.Test/DotNetCore.CAP.Test.csproj
22+
- dotnet test test/DotNetCore.CAP.Test/DotNetCore.CAP.Test.csproj

build/version.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<VersionMajor>2</VersionMajor>
44
<VersionMinor>4</VersionMinor>
5-
<VersionPatch>1</VersionPatch>
5+
<VersionPatch>2</VersionPatch>
66
<VersionQuality></VersionQuality>
77
<VersionPrefix>$(VersionMajor).$(VersionMinor).$(VersionPatch)</VersionPrefix>
88
</PropertyGroup>

samples/Sample.RabbitMQ.MongoDB/Controllers/ValuesController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public ValuesController(IMongoClient client, ICapPublisher capBus)
2222
[Route("~/without/transaction")]
2323
public IActionResult WithoutTransaction()
2424
{
25-
_capBus.Publish("sample.rabbitmq.mongodb", DateTime.Now);
25+
_capBus.PublishAsync("sample.rabbitmq.mongodb", DateTime.Now);
2626

2727
return Ok();
2828
}

samples/Sample.RabbitMQ.MongoDB/Sample.RabbitMQ.MongoDB.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp2.2</TargetFramework>
5+
<LangVersion>7.1</LangVersion>
56
</PropertyGroup>
67
<ItemGroup>
78
<PackageReference Include="Microsoft.AspNetCore.App" />

samples/Sample.RabbitMQ.MongoDB/Startup.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Microsoft.AspNetCore.Builder;
1+
using System;
2+
using Microsoft.AspNetCore.Builder;
23
using Microsoft.AspNetCore.Hosting;
34
using Microsoft.AspNetCore.Mvc;
45
using Microsoft.Extensions.Configuration;
@@ -18,14 +19,14 @@ public Startup(IConfiguration configuration)
1819

1920
public void ConfigureServices(IServiceCollection services)
2021
{
21-
services.AddSingleton<IMongoClient>(new MongoClient("mongodb://192.168.10.110:27017,192.168.10.110:27018,192.168.10.110:27019/?replicaSet=rs0"));
22+
services.AddSingleton<IMongoClient>(new MongoClient(Configuration.GetConnectionString("MongoDB")));
2223
services.AddCap(x =>
2324
{
24-
x.UseMongoDB("mongodb://192.168.10.110:27017,192.168.10.110:27018,192.168.10.110:27019/?replicaSet=rs0");
25-
x.UseRabbitMQ("localhost");
25+
x.UseMongoDB(Configuration.GetConnectionString("MongoDB"));
26+
x.UseRabbitMQ("192.168.2.120");
2627
x.UseDashboard();
2728
});
28-
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
29+
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
2930
}
3031

3132
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
22
"Logging": {
33
"LogLevel": {
4-
"Default": "Warning"
4+
"Default": "Debug"
55
}
66
},
77
"AllowedHosts": "*",
88
"ConnectionStrings": {
9-
"MongoDB": "mongodb://localhost:27017,localhost:27018,localhost:27019/?replicaSet=rs0"
9+
"MongoDB": "mongodb://192.168.2.120:27017,192.168.2.120:27018,192.168.2.120:27019/?replicaSet=rs0"
1010
},
1111
"RabbitMQ": {
1212
"HostName": "localhost",
1313
"Port": 5672,
1414
"UserName": "",
1515
"Password": ""
1616
}
17-
}
17+
}

src/DotNetCore.CAP.MySql/IMonitoringApi.MySql.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public IList<MessageDto> Messages(MessageQueryDto queryDto)
8080

8181
if (!string.IsNullOrEmpty(queryDto.Group))
8282
{
83-
where += " and Group=@Group";
83+
where += " and `Group`=@Group";
8484
}
8585

8686
if (!string.IsNullOrEmpty(queryDto.Content))

src/DotNetCore.CAP.PostgreSql/ICapPublisher.PostgreSql.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ protected override async Task ExecuteAsync(CapPublishedMessage message, ICapTran
5555
private string PrepareSql()
5656
{
5757
return
58-
$"INSERT INTO \"{_options.Schema}\".\"published\" (\"Id\",\"Version\",\"Name\",\"Content\",\"Retries\",\"Added\",\"ExpiresAt\",\"StatusName\")VALUES(@Id,@Version,@Name,@Content,@Retries,@Added,@ExpiresAt,@StatusName);";
58+
$"INSERT INTO \"{_options.Schema}\".\"published\" (\"Id\",\"Version\",\"Name\",\"Content\",\"Retries\",\"Added\",\"ExpiresAt\",\"StatusName\")VALUES(@Id,'{_options.Version}',@Name,@Content,@Retries,@Added,@ExpiresAt,@StatusName);";
5959
}
6060

6161
private IDbConnection InitDbConnection()

src/DotNetCore.CAP.SqlServer/IMonitoringApi.SqlServer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public IList<MessageDto> Messages(MessageQueryDto queryDto)
8181

8282
if (!string.IsNullOrEmpty(queryDto.Group))
8383
{
84-
where += " and group=@Group";
84+
where += " and [group]=@Group";
8585
}
8686

8787
if (!string.IsNullOrEmpty(queryDto.Content))

src/DotNetCore.CAP/CAP.AppBuilderExtensions.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ internal static class AppBuilderExtensions
2020
/// </summary>
2121
/// <param name="app">The <see cref="IApplicationBuilder" /> instance this method extends.</param>
2222
/// <returns>The <see cref="IApplicationBuilder" /> instance this method extends.</returns>
23-
public static IApplicationBuilder UseCap(this IApplicationBuilder app)
23+
public static IApplicationBuilder UseCapDashboard(this IApplicationBuilder app)
2424
{
2525
if (app == null)
2626
{
@@ -30,10 +30,7 @@ public static IApplicationBuilder UseCap(this IApplicationBuilder app)
3030
CheckRequirement(app);
3131

3232
var provider = app.ApplicationServices;
33-
34-
var bootstrapper = provider.GetRequiredService<IBootstrapper>();
35-
bootstrapper.BootstrapAsync();
36-
33+
3734
if (provider.GetService<DashboardOptions>() != null)
3835
{
3936
if (provider.GetService<DiscoveryOptions>() != null)
@@ -78,7 +75,7 @@ public Action<IApplicationBuilder> Configure(Action<IApplicationBuilder> next)
7875
{
7976
return app =>
8077
{
81-
app.UseCap();
78+
app.UseCapDashboard();
8279

8380
next(app);
8481
};

0 commit comments

Comments
 (0)