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:
@@ -46,7 +46,7 @@ public class News2ScoringService : BackgroundService
|
||||
|
||||
var evt = JsonSerializer.Deserialize<News2ObservationEvent>(
|
||||
result.Message.Value,
|
||||
new JsonSerializerOptions { PropertyNameCaseInsensitive = true })!;
|
||||
ClinicalEventJson.Options)!;
|
||||
|
||||
using var scope = _services.CreateScope();
|
||||
var detector = scope.ServiceProvider.GetRequiredService<News2Detector>();
|
||||
@@ -76,16 +76,8 @@ public class News2ScoringService : BackgroundService
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (result is not null && guard.ShouldSkip(result, ex))
|
||||
{
|
||||
consumer.Commit(result);
|
||||
continue;
|
||||
}
|
||||
|
||||
_logger.LogError(ex,
|
||||
"News2ScoringService 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(News2ScoringService), stoppingToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user