Skip to content

Commit

Permalink
升级新的mqttnet4.0 版本,升级其他库
Browse files Browse the repository at this point in the history
  • Loading branch information
maikebing committed Feb 11, 2022
1 parent 93ab8f4 commit 8d5df6b
Show file tree
Hide file tree
Showing 14 changed files with 60 additions and 57 deletions.
8 changes: 4 additions & 4 deletions IoTSharp.Data.InMemory/IoTSharp.Data.InMemory.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.UI.InMemory.Storage" Version="6.0.2" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Core" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.1">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="6.0.2" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="6.0.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\IoTSharp.Data\IoTSharp.Data.csproj" />
Expand Down
6 changes: 3 additions & 3 deletions IoTSharp.Data.MySQL/IoTSharp.Data.MySQL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
<PackageReference Include="AspNetCore.HealthChecks.MySql" Version="6.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Core" Version="6.0.2" />
<PackageReference Include="AspNetCore.HealthChecks.UI.MySql.Storage" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.1">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.2" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="6.0.2" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.1" />
<PackageReference Include="EFCore.Sharding.MySql" Version="6.0.2" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql.NetTopologySuite" Version="6.0.1" />
Expand Down
4 changes: 2 additions & 2 deletions IoTSharp.Data.Oracle/IoTSharp.Data.Oracle.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<PackageReference Include="AspNetCore.HealthChecks.UI.Core" Version="6.0.2" />
<PackageReference Include="AspNetCore.HealthChecks.UI.InMemory.Storage" Version="6.0.2" />
<PackageReference Include="EFCore.Sharding.Oracle" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.2" />
<PackageReference Include="Oracle.EntityFrameworkCore" Version="6.21.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.1">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
6 changes: 3 additions & 3 deletions IoTSharp.Data.PostgreSQL/IoTSharp.Data.PostgreSQL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
<PackageReference Include="AspNetCore.HealthChecks.NpgSql" Version="6.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.UI.PostgreSQL.Storage" Version="6.0.2" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Core" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.1">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="6.0.2" />
<PackageReference Include="Npgsql" Version="6.0.3" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.3" />
<PackageReference Include="EFCore.Sharding.PostgreSql" Version="6.0.2" />
Expand Down
2 changes: 1 addition & 1 deletion IoTSharp.Data.SqlServer/IoTSharp.Data.SqlServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<PackageReference Include="AspNetCore.HealthChecks.UI.Core" Version="6.0.2" />
<PackageReference Include="AspNetCore.HealthChecks.UI.SqlServer.Storage" Version="6.0.2" />
<PackageReference Include="EFCore.Sharding.SqlServer" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.2" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions IoTSharp.Data.Sqlite/IoTSharp.Data.Sqlite.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
<PackageReference Include="AspNetCore.HealthChecks.Sqlite" Version="6.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Sqlite.Storage" Version="6.0.2" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Core" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.1">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.2" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="6.0.2" />
<PackageReference Include="EFCore.Sharding.SQLite" Version="6.0.2" />
</ItemGroup>
<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions IoTSharp.Data/IoTSharp.Data.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Identity" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="EFCore.Sharding" Version="6.0.2" />

Expand Down
2 changes: 1 addition & 1 deletion IoTSharp.SDKs/IoTSharp.Sdk.MQTT/IoTSharp.Sdk.MQTT.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MQTTnet" Version="4.0.0-preview3" />
<PackageReference Include="MQTTnet" Version="4.0.0-preview5" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions IoTSharp/Clients/RpcClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class RpcClient : IDisposable
private readonly ConcurrentDictionary<string, TaskCompletionSource<byte[]>> _waitingCalls = new ConcurrentDictionary<string, TaskCompletionSource<byte[]>>();
private readonly MqttClient _mqttClient;
private readonly ILogger _logger;
private IMqttClientOptions _mqtt;
private MqttClientOptions _mqtt;
private bool disposedValue;

public RpcClient(MqttClient mqttClient, ILogger logger)
Expand All @@ -33,7 +33,7 @@ public RpcClient(MqttClient mqttClient, ILogger logger)



public RpcClient(IMqttClientOptions mqtt, Microsoft.Extensions.Logging.ILogger _logger) :this (new MQTTnet.MqttFactory().CreateMqttClient(), _logger)
public RpcClient(MqttClientOptions mqtt, Microsoft.Extensions.Logging.ILogger _logger) :this (new MQTTnet.MqttFactory().CreateMqttClient(), _logger)
{
_mqtt = mqtt;

Expand Down
4 changes: 2 additions & 2 deletions IoTSharp/Controllers/DevicesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace IoTSharp.Controllers
public class DevicesController : ControllerBase
{
private readonly ApplicationDbContext _context;
private readonly IMqttClientOptions _mqtt;
private readonly MqttClientOptions _mqtt;
private readonly UserManager<IdentityUser> _userManager;
private readonly SignInManager<IdentityUser> _signInManager;
private readonly ILogger _logger;
Expand All @@ -52,7 +52,7 @@ public class DevicesController : ControllerBase
private readonly ICapPublisher _queue;

public DevicesController(UserManager<IdentityUser> userManager,
SignInManager<IdentityUser> signInManager, ILogger<DevicesController> logger, MqttServer serverEx, ApplicationDbContext context, IMqttClientOptions mqtt, IStorage storage, IOptions<AppSettings> options, ICapPublisher queue)
SignInManager<IdentityUser> signInManager, ILogger<DevicesController> logger, MqttServer serverEx, ApplicationDbContext context, MqttClientOptions mqtt, IStorage storage, IOptions<AppSettings> options, ICapPublisher queue)
{
_context = context;
_mqtt = mqtt;
Expand Down
36 changes: 18 additions & 18 deletions IoTSharp/IoTSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.0.1" />
<PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.14.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.1" />
<PackageReference Include="MQTTnet" Version="4.0.0-preview3" />
<PackageReference Include="MQTTnet.AspNetCore" Version="4.0.0-preview3" />
<PackageReference Include="MQTTnet.Extensions.Rpc" Version="4.0.0-preview3" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.2" />
<PackageReference Include="MQTTnet" Version="4.0.0-preview5" />
<PackageReference Include="MQTTnet.AspNetCore" Version="4.0.0-preview5" />
<PackageReference Include="MQTTnet.Extensions.Rpc" Version="4.0.0-preview5" />
<PackageReference Include="NetMQ" Version="4.0.1.8" />
<PackageReference Include="Npgsql" Version="6.0.3" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.3" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL.NetTopologySuite" Version="6.0.3" />
<PackageReference Include="NSwag.AspNetCore" Version="13.15.7" />
<PackageReference Include="NSwag.AspNetCore" Version="13.15.9" />
<PackageReference Include="PinusDB" Version="1.0.10" />
<PackageReference Include="PinusDB.HealthChecks" Version="1.0.10" />
<PackageReference Include="ProxyKit" Version="2.3.4" />
Expand All @@ -116,23 +116,23 @@
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.15.1" />
<PackageReference Include="System.ServiceModel.Primitives" Version="4.9.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="6.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Hosting.WindowsServices" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Hosting.WindowsServices" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.2" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="6.0.0" />
<PackageReference Include="MQTTnet.Extensions.ManagedClient" Version="4.0.0-preview3" />
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="6.0.1" />
<PackageReference Include="Microsoft.AspNetCore.ApiAuthorization.IdentityServer" Version="6.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="6.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.1" />
<PackageReference Include="MQTTnet.Extensions.ManagedClient" Version="4.0.0-preview5" />
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="6.0.2" />
<PackageReference Include="Microsoft.AspNetCore.ApiAuthorization.IdentityServer" Version="6.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="6.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.2" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.1">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion appsettings.Development.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"ConnectionStrings": {
"IoTSharp": "Server=pgsql;Database=IoTSharp;Username=postgres;Password=future;Pooling=true;MaxPoolSize=1024;",
"EventBusStore": "mongodb://root:kissme@mongodb:27017",
"TelemetryStorage": "http://influx:8086/?org=iotsharp&bucket=iotsharp-bucket&token=iotsharp-token&&latest=-72h",
"TelemetryStorage": "http://influx:8086/?org=iotsharp&bucket=iotsharp-bucket&token=koMHcRQ9PJVPIIb6zFyLt-06EkM_oy1jut08bH7f0BwC85LUO6zxgihKZUayHzyetapJEkxrlO0KwJ278dKpnA==&&latest=-72h",
"EventBusMQ": "amqp://root:kissme@rabbitmq:5672"
},
"JwtKey": "kissmekissmekissmekissmekissmekissmekissmekissmekissmekissmekissmekissmekissmekissmekissmekissme",
Expand Down
16 changes: 8 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,14 @@ services:
networks:
- iotsharp-network

influxdb_cli:
links:
- influx
image: quay.io/influxdb/influxdb:v2.0.4
entrypoint: influx setup --bucket iotsharp-bucket -t iotsharp-token -o iotsharp --username=root --password=1-q2-w3-e4-r5-t --host=http://influx:8086 -f
restart: on-failure:20
depends_on:
- influx
#influxdb_cli:
# links:
# - influx
# image: quay.io/influxdb/influxdb:v2.0.4
# entrypoint: influx setup --bucket iotsharp-bucket -t koMHcRQ9PJVPIIb6zFyLt-06EkM_oy1jut08bH7f0BwC85LUO6zxgihKZUayHzyetapJEkxrlO0KwJ278dKpnA== -o iotsharp --username=root --password=1-q2-w3-e4-r5-t --host=http://influx:8086 -f
# restart: on-failure:20
# depends_on:
# - influx

networks:
iotsharp-network:
Expand Down
15 changes: 9 additions & 6 deletions launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@
"profiles": {
"Docker Compose": {
"commandName": "DockerCompose",
"composeLaunchAction": "LaunchBrowser",
"composeLaunchServiceName": "iotsharp",
"composeLaunchUrl": "{Scheme}://localhost:{ServicePort}",
"commandVersion": "1.0",
"serviceActions": {
"iotsharp": "StartDebugging",
"pgadmin": "StartWithoutDebugging",
"pgsql": "StartWithoutDebugging"
},
"composeLaunchAction": "LaunchBrowser",
"commandVersion": "1.0",
"composeLaunchUrl": "{Scheme}://localhost:{ServicePort}"
"pgsql": "StartWithoutDebugging",
"influx": "StartWithoutDebugging",
"mongodb": "StartWithoutDebugging",
"rabbitmq": "StartWithoutDebugging"
}
}
}
}
}

0 comments on commit 8d5df6b

Please sign in to comment.