Fix Kafka retry seek, bound buffers, and cut hot-path CPU/memory waste (Phases 41–44).
Stop consumers from committing past failed offsets, harden Rabbit/DataLake/gateway backpressure, dispose JsonDocument/MinIO correctly, and batch expensive DB/HTTP paths. Track progress in docs/performance.
This commit is contained in:
+4
-9
@@ -85,13 +85,8 @@ public sealed class NotificationPublisherService : BackgroundService
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (guard.ShouldSkip(result, ex))
|
||||
{
|
||||
consumer.Commit(result);
|
||||
continue;
|
||||
}
|
||||
|
||||
_logger.LogError(ex, "NotificationPublisher failed to process message from {Topic} — will retry", result.Topic);
|
||||
await KafkaConsumerRetry.HandleFailureAsync(
|
||||
consumer, result, ex, guard, _logger, nameof(NotificationPublisherService), stoppingToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -104,7 +99,7 @@ public sealed class NotificationPublisherService : BackgroundService
|
||||
private Task HandleAlertGeneratedAsync(
|
||||
IModel chan, IBasicProperties props, string payload, CancellationToken ct)
|
||||
{
|
||||
var doc = JsonDocument.Parse(payload);
|
||||
using var doc = JsonDocument.Parse(payload);
|
||||
var severity = doc.RootElement.GetProperty("severity").GetString();
|
||||
|
||||
if (!string.Equals(severity, "Critical", StringComparison.OrdinalIgnoreCase))
|
||||
@@ -142,7 +137,7 @@ public sealed class NotificationPublisherService : BackgroundService
|
||||
private Task HandleEncounterStatusChangedAsync(
|
||||
IModel chan, IBasicProperties props, string payload, CancellationToken ct)
|
||||
{
|
||||
var doc = JsonDocument.Parse(payload);
|
||||
using var doc = JsonDocument.Parse(payload);
|
||||
var newStatus = doc.RootElement.GetProperty("newStatus").GetString();
|
||||
|
||||
if (!string.Equals(newStatus, "Discharged", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
Reference in New Issue
Block a user