Skip to content

Commit b2770e5

Browse files
authored
Merge pull request #5659 from Particular/john/remove_signalr
Remove SignalR
2 parents 89c8e8c + 393a36a commit b2770e5

46 files changed

Lines changed: 35 additions & 520 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ServiceControl ![Current Version](https://img.shields.io/github/release/particular/servicecontrol.svg?style=flat&label=current%20version)
22

3-
ServiceControl is the monitoring brain in the [Particular Service Platform](https://particular.net/service-platform), which includes [NServiceBus](https://particular.net/nservicebus) and tools to build, monitor, and debug distributed systems. ServiceControl collects data on every single message flowing through the system (Audit Queue), errors (Error Queue), as well as additional information regarding sagas, endpoints heartbeats, and custom checks (Control Queue). The information is then exposed to [ServicePulse](https://particular.net/servicepulse) and [ServiceInsight](https://particular.net/serviceinsight) via an HTTP API and SignalR notifications.
3+
ServiceControl is the monitoring brain in the [Particular Service Platform](https://particular.net/service-platform), which includes [NServiceBus](https://particular.net/nservicebus) and tools to build, monitor, and debug distributed systems. ServiceControl collects data on every single message flowing through the system (Audit Queue), errors (Error Queue), as well as additional information regarding sagas, endpoints heartbeats, and custom checks (Control Queue). The information is then exposed to [ServicePulse](https://particular.net/servicepulse) and [ServiceInsight](https://particular.net/serviceinsight) via an HTTP API.
44

55
See the [ServiceControl documentation](https://docs.particular.net/servicecontrol/) for more information.
66

docs/reverseproxy-testing.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ This guide provides scenario-based tests for ServiceControl instances behind an
66
- Forwarded headers handling (`X-Forwarded-For`, `X-Forwarded-Proto`, `X-Forwarded-Host`)
77
- HTTP to HTTPS redirection
88
- HSTS (HTTP Strict Transport Security)
9-
- WebSocket support (SignalR)
109

1110
## Instance Reference
1211

src/Directory.Packages.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="$(RuntimeFrameworkVersion)" />
2323
<PackageVersion Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="$(RuntimeFrameworkVersion)" />
2424
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="$(RuntimeFrameworkVersion)" />
25-
<PackageVersion Include="Microsoft.AspNetCore.SignalR.Client" Version="$(RuntimeFrameworkVersion)" />
2625
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="$(RuntimeFrameworkVersion)" />
2726
<PackageVersion Include="Microsoft.Extensions.DependencyModel" Version="$(RuntimeFrameworkVersion)" />
2827
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="$(RuntimeFrameworkVersion)" />

src/ServiceControl.AcceptanceTests.RavenDB/ServiceControl.AcceptanceTests.RavenDB.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
<ItemGroup>
1616
<PackageReference Include="GitHubActionsTestLogger" />
1717
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" />
18-
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" />
1918
<PackageReference Include="Microsoft.NET.Test.Sdk" />
2019
<PackageReference Include="NServiceBus.Heartbeat" />
2120
<PackageReference Include="NServiceBus.SagaAudit" />

src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_a_periodic_custom_check_fails.cs

Lines changed: 5 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,15 @@
22
{
33
using System;
44
using System.Linq;
5-
using System.Net.Http;
6-
using System.Text.Json;
75
using System.Threading;
86
using System.Threading.Tasks;
97
using AcceptanceTesting;
108
using AcceptanceTesting.EndpointTemplates;
119
using Contracts.CustomChecks;
1210
using EventLog;
13-
using Microsoft.AspNetCore.SignalR.Client;
14-
using Microsoft.Extensions.DependencyInjection;
1511
using NServiceBus;
1612
using NServiceBus.AcceptanceTesting;
1713
using NServiceBus.CustomChecks;
18-
using NServiceBus.Features;
1914
using NUnit.Framework;
2015
using ServiceBus.Management.Infrastructure.Settings;
2116
using Conventions = NServiceBus.AcceptanceTesting.Customization.Conventions;
@@ -28,7 +23,7 @@ public async Task Should_result_in_a_custom_check_failed_event()
2823
{
2924
EventLogItem entry = null;
3025

31-
await Define<MyContext>(ctx => { ctx.SignalrStarted = true; })
26+
await Define<MyContext>()
3227
.WithEndpoint<WithCustomCheck>()
3328
.Done(async c =>
3429
{
@@ -46,92 +41,18 @@ public async Task Should_result_in_a_custom_check_failed_event()
4641
}
4742
}
4843

49-
[Test]
50-
public async Task Should_raise_a_signalr_event()
51-
{
52-
var context = await Define<MyContext>(
53-
ctx =>
54-
{
55-
ctx.HttpMessageHandlerFactory = () => HttpMessageHandlerFactory();
56-
})
57-
.WithEndpoint<WithCustomCheck>()
58-
.WithEndpoint<EndpointThatUsesSignalR>()
59-
.Done(c => c.SignalrEventReceived)
60-
.Run();
61-
62-
Assert.That(context.SignalrData, Is.Not.Null);
63-
}
64-
65-
public class MyContext : ScenarioContext
66-
{
67-
public bool SignalrEventReceived { get; set; }
68-
public string SignalrData { get; set; }
69-
public Func<HttpMessageHandler> HttpMessageHandlerFactory { get; set; }
70-
public bool SignalrStarted { get; set; }
71-
}
72-
73-
public class EndpointThatUsesSignalR : EndpointConfigurationBuilder
74-
{
75-
public EndpointThatUsesSignalR() => EndpointSetup<DefaultServerWithoutAudit>(c => c.EnableFeature<EnableSignalR>());
76-
77-
class EnableSignalR : Feature
78-
{
79-
protected override void Setup(FeatureConfigurationContext context)
80-
{
81-
context.Services.AddSingleton<SignalrStarter>();
82-
context.RegisterStartupTask(provider => provider.GetRequiredService<SignalrStarter>());
83-
}
84-
85-
class SignalrStarter : FeatureStartupTask
86-
{
87-
public SignalrStarter(MyContext context)
88-
{
89-
this.context = context;
90-
connection = new HubConnectionBuilder()
91-
.WithUrl("http://localhost/api/messagestream", o => o.HttpMessageHandlerFactory = _ => context.HttpMessageHandlerFactory())
92-
.Build();
93-
}
94-
95-
void EnvelopeReceived(JsonElement jElement)
96-
{
97-
var s = jElement.ToString();
98-
if (s.IndexOf("\"CustomCheckFailed\"", StringComparison.Ordinal) <= 0)
99-
{
100-
return;
101-
}
102-
103-
context.SignalrData = s;
104-
context.SignalrEventReceived = true;
105-
}
106-
107-
protected override async Task OnStart(IMessageSession session, CancellationToken cancellationToken = default)
108-
{
109-
// We might also be able to strongly type this to match instead of just getting a string?
110-
connection.On<JsonElement>("PushEnvelope", EnvelopeReceived);
111-
112-
await connection.StartAsync(cancellationToken);
113-
114-
context.SignalrStarted = connection.State == HubConnectionState.Connected;
115-
}
116-
117-
protected override Task OnStop(IMessageSession session, CancellationToken cancellationToken = default) => connection.StopAsync(cancellationToken);
118-
119-
readonly MyContext context;
120-
readonly HubConnection connection;
121-
}
122-
}
123-
}
44+
public class MyContext : ScenarioContext;
12445

12546
public class WithCustomCheck : EndpointConfigurationBuilder
12647
{
12748
public WithCustomCheck() => EndpointSetup<DefaultServerWithoutAudit>(c => { c.ReportCustomChecksTo(Settings.DEFAULT_INSTANCE_NAME, TimeSpan.FromSeconds(1)); });
12849

129-
class FailingCustomCheck(MyContext context)
50+
class FailingCustomCheck()
13051
: NServiceBus.CustomChecks.CustomCheck("MyCustomCheckId", "MyCategory", TimeSpan.FromSeconds(5))
13152
{
13253
public override Task<CheckResult> PerformCheck(CancellationToken cancellationToken = default)
13354
{
134-
if (executed && context.SignalrStarted)
55+
if (executed)
13556
{
13657
return Task.FromResult(CheckResult.Failed("Some reason"));
13758
}
@@ -145,4 +66,4 @@ public override Task<CheckResult> PerformCheck(CancellationToken cancellationTok
14566
}
14667
}
14768
}
148-
}
69+
}

src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_reporting_custom_check_with_signalr.cs

Lines changed: 0 additions & 118 deletions
This file was deleted.

0 commit comments

Comments
 (0)