-
Notifications
You must be signed in to change notification settings - Fork 3
Dev/batched messeages #932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 2.x
Are you sure you want to change the base?
Conversation
… save info on failures, multi dispatch
| $batch = $batchRepository->getBatch($stamp->batchId); | ||
| $batchRepository->setIterationStatus($stamp->batchId, $stamp->iteration, BatchStatus::SUCCESS, $message); | ||
|
|
||
| if ($batch->isChain) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jvangestel Wat gebeurt er met een chained batch als de eerste uit de chain faalt? De eerste krijgt dan status failed, maar alle die daar na komen blijven staan op pending? Komen die later nog door? Worden ze ooit opgeruimd?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rvm-peercode Wanneer het gaat om een chain (een voor een) wordt de rest van de chain nu ook op failed gezet.
| try { | ||
| return $serializer->deserialize($data['gba_message'], $data['gba_message_class'], 'json'); | ||
| } catch(Exception $e) { | ||
| return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moet hier niet nog iets gelogd worden?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dit wordt nu gelogged in de info Kolom van de iteratie, incl een failure status
|
|
||
| public function getBatch(string $batchId): Batch|null | ||
| { | ||
| $data = $this->resultFetcher->fetchRow('SELECT * FROM gems__batch WHERE gba_id = ?', [$batchId]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Volgens mij kun je hier meerdere records terugkrijgen (alle iterations). Dus ik zou in elk geval een ORDER BY toevoegen zodat je zeker weet welke je terugkrijgt, en misschien een opmerking in de docblock dat dat by design is.
-> Je gebruikt uiteindelijk ook de status en finished kolommen, maar die zullen niet voor elke iteration gelijk zijn.
Wat hoort dit terug te geven als de eerste iteration al wel gefinished is, maar de tweede niet?
Misschien specifiek de eerste of laatste iteration pakken?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ik heb dit (incl de hele batch object) een algemenere query van gemaakt met statistieken van de hele batch. Deze geldt dan alleen voor de batchId, en niet meer specifiek voor een iteratie
| $batchId, | ||
| BatchStatus::PENDING->value, | ||
| ]) > 0; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Omdat je meerdere iterations kunt hebben kan het met de isPending() en isRunning() dus voorkomen dat beiden waar zijn. Ik heb het gebruik van de iterations nog niet helemaal helder, maar om dit expliciet te maken zou ik ofwel alleen kijken naar de status van de laatste iteration, of, als het normaal is dat er meerdere iterations zijn, de functienamen hernoemen naar hasPending() en hasRunning().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aangepast naar hasPending, maar isRunning is logischer voor een hele batch.
|
|
||
| public function setIterationFinished(string $batchId, int $iteration, string|null $message = null): void | ||
| { | ||
| $this->resultFetcher->updateTable('gems__batch', [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deze function body zou ik vervangen door een aanroep naar setIterationStatus()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Helemaal uit de store gehaald. Aangepast in de MessengerBatchRepository
Add batched messaging support, to track and chain message queue messages.
In RunCommJob chaining messages is required when async processing is turned on, or the execution order will not be correct.
This does lose the interactive console logging during the run, only after every job is complete will it report.