Conversation
wheres-my-pizza/README.md
Outdated
| ## Guidelines from Author | ||
|
|
||
| 1. Tests first. Spin up PostgreSQL + RabbitMQ with Testcontainers-go and create unit/contract/e2e tests that should fail until each step is implemented. | ||
| 2. Implement database schema and outbox publisher. | ||
| 3. Wire minimal consumer in `kitchen`; emit `Boxed`. | ||
| 4. Add `delivery` with payment simulation. | ||
| 5. Introduce retry exchange & DLQ. | ||
| 6. Write e2e tests with **Testcontainers-go**. | ||
|
|
There was a problem hiding this comment.
Double-check что нужно использовать что нет
wheres-my-pizza/README.md
Outdated
| - Event-driven architecture | ||
| - RabbitMQ: work-queue, fan-out, dead-letter / retry queues, manual **ACK/NACK + QoS** | ||
| - Exchange types & routing keys | ||
| - Transactional Outbox pattern (**events** table) + PostgreSQL | ||
| - Idempotent message processing (Inbox tables) | ||
| - Docker-Compose orchestration | ||
| - Unit, contract & end-to-end testing |
wheres-my-pizza/README.md
Outdated
| Build **wheres-my-pizza**, a three-service Go application that tracks a pizza order from placement to delivery. | ||
| All inter-service communication happens through RabbitMQ events—**no synchronous HTTP**. | ||
| A single transactional outbox keeps the DB and broker consistent; consumers stay idempotent via inbox tables. | ||
| The public REST API is **read-only** and lets clients query order status and full event history. | ||
|
|
There was a problem hiding this comment.
Слишком сложно, многие понятие студенту не открыты, твоя цель провести студента по образовательному пути, а не дать пощечину и почувствовать себя глупым
There was a problem hiding this comment.
Может в optional добавить? чего много/сложно.
wheres-my-pizza/README.md
Outdated
| > you can’t polish your way out of bad architecture | ||
| > |
There was a problem hiding this comment.
| > you can’t polish your way out of bad architecture | |
| > | |
| > You can’t polish your way out of bad architecture. |
wheres-my-pizza/README.md
Outdated
|
|
||
| **Work Queue Pattern** | ||
| - One producer sends tasks to a queue | ||
| - Multiple consumers compete to receive tasks |
There was a problem hiding this comment.
| - Multiple consumers compete to receive tasks | |
| - Multiple consumers wait for the task to arrive, but only one receives it. |
There was a problem hiding this comment.
- Таблицы, сделай как в в техдизайне. Каждый сервис должен иметь свою таблицу
- Формат логов
- Нарисовать в виде ASCII схему взаимодейсвтия
wheres-my-pizza/README.md
Outdated
| ## Database Schema | ||
|
|
||
| ### Orders Table | ||
|
|
There was a problem hiding this comment.
Не хватает описания каждой таблицы, для чего где используется
There was a problem hiding this comment.
В таблицах используй простой text, а не varchar
wheres-my-pizza/README.md
Outdated
| create table order_status_log ( | ||
| "id" uuid primary key default gen_random_uuid(), | ||
| "created_at" timestamptz not null default now(), | ||
| order_id varchar(20) references orders(id), | ||
| "status" varchar(20), | ||
| "changed_by" varchar(50), | ||
| "changed_at" timestamp default current_timestamp, | ||
| "notes" text |
wheres-my-pizza/README.md
Outdated
| ## RabbitMQ Configuration | ||
|
|
||
| ### Exchanges and Queues Setup | ||
|
|
||
| ``` | ||
| Exchanges: | ||
| ├── orders_direct (type: direct, durable: true) | ||
| │ └── Routing Keys: | ||
| │ ├── kitchen.dine-in | ||
| │ ├── kitchen.takeout | ||
| │ └── kitchen.delivery | ||
| │ | ||
| └── notifications_fanout (type: fanout, durable: true) | ||
| └── Broadcasts to all subscribers | ||
|
|
||
| Queues: | ||
| ├── kitchen_queue (durable: true, x-max-priority: 10) | ||
| ├── kitchen_dine_in_queue (durable: true, x-max-priority: 10) | ||
| ├── kitchen_takeout_queue (durable: true, x-max-priority: 10) | ||
| ├── kitchen_delivery_queue (durable: true, x-max-priority: 10) | ||
| └── notifications_queue (durable: true, auto-delete: false) | ||
| ``` |
There was a problem hiding this comment.
Надо объяснить, даже мне непонятно. Нужно раскрыть в чем отличие fanout от direct
wheres-my-pizza/README.md
Outdated
| ### Message Formats | ||
|
|
||
| **Order Message** | ||
| ```json | ||
| { | ||
| "order_number": "ORD_20241216_001", | ||
| "customer_name": "John Doe", | ||
| "customer_type": "vip", | ||
| "order_type": "delivery", | ||
| "table_number": null, | ||
| "delivery_address": "123 Main St, City", | ||
| "items": [ | ||
| { | ||
| "name": "Margherita Pizza", | ||
| "quantity": 1, | ||
| "price": 15.99 | ||
| } | ||
| ], | ||
| "total_amount": 15.99, | ||
| "priority": 10 | ||
| } | ||
| ``` | ||
|
|
||
| **Status Update Message** | ||
| ```json | ||
| { | ||
| "order_number": "ORD_20241216_001", | ||
| "old_status": "received", | ||
| "new_status": "cooking", | ||
| "changed_by": "chef_mario", | ||
| "timestamp": "2024-12-16T10:32:00Z", | ||
| "estimated_completion": "2024-12-16T10:42:00Z" | ||
| } | ||
| ``` |
There was a problem hiding this comment.
Описать что за message, куда падает, кто читает
wheres-my-pizza/README.md
Outdated
| **Required Log Events:** | ||
| - Order received/processed/completed | ||
| - Worker connected/disconnected | ||
| - Status changes | ||
| - Error conditions and recoveries | ||
| - Performance metrics (processing times) |
There was a problem hiding this comment.
Где какой уровень использовать
wheres-my-pizza/README.md
Outdated
| #### Order Processing Flow: | ||
|
|
||
| 1. Order Service receives HTTP POST request | ||
| 2. Validates request data and calculates totals | ||
| 3. Stores order in PostgreSQL orders table | ||
| 4. Publishes order message to RabbitMQ | ||
| 5. Kitchen Worker consumes order from queue | ||
| 6. Updates order status to 'cooking' in database | ||
| 7. Simulates cooking process (configurable duration) | ||
| 8. Updates order status to 'ready' in database | ||
| 9. Logs completion and acknowledges message | ||
|
|
||
| Outcomes: |
There was a problem hiding this comment.
Не хватает консистенси: #### Order Processing Flow: и Orders:
Надо использовать хеши
wheres-my-pizza/README.md
Outdated
| #### Order Processing Flow: | ||
|
|
||
| 1. Order Service receives HTTP POST request | ||
| 2. Validates request data and calculates totals | ||
| 3. Stores order in PostgreSQL orders table | ||
| 4. Publishes order message to RabbitMQ | ||
| 5. Kitchen Worker consumes order from queue | ||
| 6. Updates order status to 'cooking' in database | ||
| 7. Simulates cooking process (configurable duration) | ||
| 8. Updates order status to 'ready' in database | ||
| 9. Logs completion and acknowledges message |
There was a problem hiding this comment.
Если бы ты делал этот проект, ты бы много уточнял у Аяжан. А как валидировать, как высчитывать. Не хватает деталей
wheres-my-pizza/README.md
Outdated
| # Initialize database and queues | ||
| $ ./restaurant-system --setup-db --db="postgres://user:password@localhost/restaurant" | ||
| $ ./restaurant-system --setup-queues --rabbitmq="localhost:5672" |
There was a problem hiding this comment.
Где он хранит эти конфигурации?
atlekbai
left a comment
There was a problem hiding this comment.
- Раздели задачи по фичам, чтобы в каждом задании были описаны элементы только одной части микросервиса: форматы сообщений, запросы, логи, флаги, примеры
- Добавь диаграммы, контекст и описание и этого маркдауна
Добавил учебный проект wheres-my-pizza — трёхсервисное Go-приложение, построенное на RabbitMQ + PostgreSQL с шаблоном «Transactional Outbox / Inbox». Цель - показать, как реализовать надёжную event-driven цепочку Order Placed => Kitchen => Delivery с ретраями, DLQ и идемпотентной обработкой.