AKrasnyatov/hw20#125
Open
AleksandKrasnyatov wants to merge 37 commits into
Open
Conversation
| sleep(random_int(10, 30)); | ||
| $task->finish(); | ||
| } catch (Throwable $e) { | ||
| $task->cancel(); |
There was a problem hiding this comment.
А как происходит reject для dlx и всего связанного?
| } catch (\RuntimeException $e) { | ||
| // Сбой — reject без requeue: сообщение уходит в work.dlx, тогда retry_queue, | ||
| // отлёживается RETRY_TTL_MS и возвращается в work.queue. | ||
| $message->reject(requeue: false); |
There was a problem hiding this comment.
В handler'е выше ловится \Throwable - любое исключение, сюда мы не попадём ведь
| try { | ||
| $queryResponse = $this->handler->handle(new GetTaskStatusQuery($taskId)); | ||
| } catch (Throwable $exception) { | ||
| return new JsonResponse(['message' => $exception->getMessage()], 404); |
There was a problem hiding this comment.
Насколько уместно использовать 404 для ошибок? Со стороны клиента не очень семантически прозрачно, что тут именно ошибка, а не url/ресурс неверный
|
|
||
|
|
||
| $amqpMessage = new AMQPMessage( | ||
| body: serialize($message), |
There was a problem hiding this comment.
serialize сам по себе не отдаёт json, но заголовок указан как application/json
| /** | ||
| * Routing key для всех сообщений демо (default-стиль: один ключ). | ||
| */ | ||
| public const string ROUTING_KEY = 'notification'; |
There was a problem hiding this comment.
Это, вероятно, осталось с прошлого ДЗ? notification семантически сюда вряд ли подходит
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.