Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/IoTSharp/IoTSharp
- Loading branch information
Showing
5 changed files
with
144 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
| ||
using Microsoft.AspNetCore.Builder; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using IoTSharp.Contracts; | ||
|
||
namespace IoTSharp.EventBus.NServiceBus | ||
{ | ||
public static class DependencyInjection | ||
{ | ||
|
||
public static IApplicationBuilder UseNServiceBusEventBus(this IApplicationBuilder app) | ||
{ | ||
var provider = app.ApplicationServices; | ||
var options = provider.GetService<EventBusOption>(); | ||
return app; | ||
} | ||
|
||
public static void UseNServiceBus(this EventBusOption opt) | ||
{ | ||
var settings = opt.AppSettings; | ||
var healthChecks = opt.HealthChecks; | ||
var _EventBusStore = opt.EventBusStore; | ||
var _EventBusMQ = opt.EventBusMQ; | ||
var services = opt.services; | ||
services.AddTransient<ISubscriber, NSBusSubscriber>(); | ||
services.AddTransient<IPublisher, NSBusPublisher>(); | ||
} | ||
|
||
|
||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
IoTSharp.EventBus.NServiceBus/IoTSharp.EventBus.NServiceBus.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="NServiceBus" Version="8.1.6" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\IoTSharp.EventBus\IoTSharp.EventBus.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
| ||
using IoTSharp.Contracts; | ||
using IoTSharp.Data; | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
||
namespace IoTSharp.EventBus.NServiceBus | ||
{ | ||
public class NSBusPublisher : IPublisher | ||
{ | ||
public Task<EventBusMetrics> GetMetrics() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Task PublishActive(Guid devid, ActivityStatus activity) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Task PublishAttributeData(PlayloadData msg) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Task PublishConnect(Guid devid, ConnectStatus devicestatus) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Task PublishCreateDevice(Guid devid) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Task PublishDeleteDevice(Guid devid) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Task PublishDeviceAlarm(CreateAlarmDto alarmDto) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Task PublishTelemetryData(PlayloadData msg) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
| ||
using EasyCaching.Core; | ||
using IoTSharp.Contracts; | ||
using IoTSharp.Data; | ||
using IoTSharp.Data.Extensions; | ||
using IoTSharp.Extensions; | ||
using IoTSharp.Storage; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.Logging; | ||
using Microsoft.Extensions.Options; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Dynamic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
||
namespace IoTSharp.EventBus.NServiceBus | ||
{ | ||
|
||
public class NSBusSubscriber : EventBusSubscriber, ISubscriber | ||
{ | ||
public NSBusSubscriber(ILogger<EventBusSubscriber> logger, IServiceScopeFactory scopeFactor | ||
, IStorage storage, IEasyCachingProviderFactory factory, EventBusOption eventBusOption | ||
) : base(logger, scopeFactor, storage, factory, eventBusOption) | ||
{ | ||
|
||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters