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:
@@ -55,7 +55,7 @@ public class SofaScoringService : BackgroundService
|
||||
{
|
||||
var gcsEvt = JsonSerializer.Deserialize<GcsScoredEvent>(
|
||||
result.Message.Value,
|
||||
new JsonSerializerOptions { PropertyNameCaseInsensitive = true })!;
|
||||
ClinicalEventJson.Options)!;
|
||||
|
||||
var outcome = await detector.ProcessGcsScoredAsync(
|
||||
gcsEvt.EncounterId, gcsEvt.PatientId, stoppingToken);
|
||||
@@ -73,7 +73,7 @@ public class SofaScoringService : BackgroundService
|
||||
{
|
||||
var evt = JsonSerializer.Deserialize<News2ObservationEvent>(
|
||||
result.Message.Value,
|
||||
new JsonSerializerOptions { PropertyNameCaseInsensitive = true })!;
|
||||
ClinicalEventJson.Options)!;
|
||||
|
||||
var outcome = await detector.ProcessObservationAsync(
|
||||
evt.EncounterId,
|
||||
@@ -102,16 +102,8 @@ public class SofaScoringService : BackgroundService
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (result is not null && guard.ShouldSkip(result, ex))
|
||||
{
|
||||
consumer.Commit(result);
|
||||
continue;
|
||||
}
|
||||
|
||||
_logger.LogError(ex,
|
||||
"SofaScoringService failed on topic={Topic} offset={Offset} — will retry",
|
||||
result?.Topic, result?.Offset.Value);
|
||||
await Task.Delay(2000, stoppingToken);
|
||||
await KafkaConsumerRetry.HandleFailureAsync(
|
||||
consumer, result, ex, guard, _logger, nameof(SofaScoringService), stoppingToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user