Skip to content

Commit a91e50e

Browse files
committed
Only require endpoint name to be available when detecting receiving endpoint details
1 parent 821f4d9 commit a91e50e

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_ingesting_failed_message_with_missing_headers.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ public async Task Should_include_headers_required_by_ServicePulse()
4444
{
4545
c.AddMinimalRequiredHeaders();
4646

47-
// This is needed for ServiceControl to be able to detect both endpoint (via failed q header) and host via the processing machine header
48-
// Missing endpoint or host will cause a null ref in ServicePulse
49-
c.Headers[Headers.ProcessingMachine] = "MyMachine";
50-
5147
c.Headers["NServiceBus.ExceptionInfo.ExceptionType"] = "SomeExceptionType";
5248
c.Headers["NServiceBus.ExceptionInfo.Message"] = "Some message";
5349
})
@@ -62,7 +58,6 @@ public async Task Should_include_headers_required_by_ServicePulse()
6258
// ServicePulse assumes that the receiving endpoint name is present
6359
Assert.That(failure.ReceivingEndpoint, Is.Not.Null);
6460
Assert.That(failure.ReceivingEndpoint.Name, Is.EqualTo(context.EndpointNameOfReceivingEndpoint));
65-
Assert.That(failure.ReceivingEndpoint.Host, Is.EqualTo("MyMachine"));
6661

6762
// ServicePulse needs both an exception type and description to render the UI in a resonable way
6863
Assert.That(failure.Exception.ExceptionType, Is.EqualTo("SomeExceptionType"));

src/ServiceControl/Operations/EndpointDetailsParser.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ public static EndpointDetails ReceivingEndpoint(IReadOnlyDictionary<string, stri
7979
endpoint.Host = queueAndMachinename.Machine;
8080
}
8181

82-
// If we've been now able to get the endpoint details, return the new info.
83-
if (!string.IsNullOrEmpty(endpoint.Name) && !string.IsNullOrEmpty(endpoint.Host))
82+
// If we've been now able to get at least the endpoint name, return the new info.
83+
if (!string.IsNullOrEmpty(endpoint.Name))
8484
{
8585
return endpoint;
8686
}

0 commit comments

Comments
 (0)