knowledge(performance): add job queue reliability guidance

This commit is contained in:
demiliani 2026-09-01 09:09:01 +02:00
parent 85ceaaa1a4
commit dbed0dc081
20 changed files with 488 additions and 2 deletions

View file

@ -0,0 +1,57 @@
table 50112 "Queued Export Bad"
{
DataClassification = CustomerContent;
fields
{
field(1; "Entry No."; Integer)
{
AutoIncrement = true;
}
field(2; Payload; Text[250])
{
}
}
keys
{
key(PK; "Entry No.")
{
Clustered = true;
}
}
}
codeunit 50112 "Queued Export Worker Bad"
{
TableNo = "Job Queue Entry";
trigger OnRun()
var
QueuedExport: Record "Queued Export Bad";
Client: HttpClient;
Content: HttpContent;
Response: HttpResponseMessage;
begin
if not QueuedExport.FindFirst() then
exit;
Content.WriteFrom(QueuedExport.Payload);
Client.Post('https://example.local/exports', Content, Response);
if not Response.IsSuccessStatusCode() then
Error('Export failed with HTTP status %1.', Response.HttpStatusCode());
// If this local step fails, the external export exists but this row is retried.
UpdateLocalStatus();
FinalizeExport(QueuedExport);
end;
local procedure UpdateLocalStatus()
begin
end;
local procedure FinalizeExport(var QueuedExport: Record "Queued Export Bad")
begin
QueuedExport.Delete();
end;
}