Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public async Task Should_be_ingested_when_minimal_required_headers_is_present()
//No failure time will result in utc now being used
Assert.That(failure.TimeOfFailure, Is.GreaterThan(testStartTime));

// Both host and endpoint name is currently needed so this will be null since no host can be detected from the failed q header
Assert.That(failure.ReceivingEndpoint, Is.Null);
Assert.That(failure.ReceivingEndpoint, Is.Not.Null);
Assert.That(failure.ReceivingEndpoint.Name, Is.EqualTo(context.EndpointNameOfReceivingEndpoint));
}

[Test]
Expand All @@ -45,10 +45,6 @@ public async Task Should_include_headers_required_by_ServicePulse()
{
c.AddMinimalRequiredHeaders();

// This is needed for ServiceControl to be able to detect both endpoint (via failed q header) and host via the processing machine header
// Missing endpoint or host will cause a null ref in ServicePulse
c.Headers[Headers.ProcessingMachine] = "MyMachine";

c.Headers[FaultsHeaderKeys.ExceptionType] = "SomeExceptionType";
c.Headers[FaultsHeaderKeys.Message] = "Some message";
})
Expand All @@ -60,11 +56,6 @@ public async Task Should_include_headers_required_by_ServicePulse()

Assert.That(failure, Is.Not.Null);

// ServicePulse assumes that the receiving endpoint name is present
Assert.That(failure.ReceivingEndpoint, Is.Not.Null);
Assert.That(failure.ReceivingEndpoint.Name, Is.EqualTo(context.EndpointNameOfReceivingEndpoint));
Assert.That(failure.ReceivingEndpoint.Host, Is.EqualTo("MyMachine"));

// ServicePulse needs both an exception type and description to render the UI in a resonable way
Assert.That(failure.Exception.ExceptionType, Is.EqualTo("SomeExceptionType"));
Assert.That(failure.Exception.Message, Is.EqualTo("Some message"));
Expand Down
4 changes: 2 additions & 2 deletions src/ServiceControl/Operations/EndpointDetailsParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ public static EndpointDetails ReceivingEndpoint(IReadOnlyDictionary<string, stri
endpoint.Host = queueAndMachinename.Machine;
}

// If we've been now able to get the endpoint details, return the new info.
if (!string.IsNullOrEmpty(endpoint.Name) && !string.IsNullOrEmpty(endpoint.Host))
// If we've been now able to get at least the endpoint name, return the new info.
if (!string.IsNullOrEmpty(endpoint.Name))
{
return endpoint;
}
Expand Down