The Restaurant Service in the FTGO application manages the restaurants that list their menus on the platform. It stores each restaurant’s profile and menu, exposes a REST API for registration and lookup, and publishes domain events that allow other services — including the Order Service, Kitchen Service, and Delivery Service — to replicate restaurant data locally. This page covers the service’s responsibilities, domain model, REST API, messaging, and database schema.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/microservices-patterns/ftgo-application/llms.txt
Use this file to discover all available pages before exploring further.
Responsibilities
- Register new restaurants with a name, address, and menu
- Persist restaurant data as
Restaurantaggregates in MySQL - Publish a
RestaurantCreatedevent so downstream services can build their own local replicas - Publish a
RestaurantMenuRevisedevent when a menu is updated - Expose a read endpoint for restaurant lookups
Domain Model
The core entity isRestaurant, persisted to the restaurants table.
| Field | Type | Notes |
|---|---|---|
id | Long | Auto-generated primary key |
name | String | Display name of the restaurant |
menu | RestaurantMenu | Embedded; contains a list of MenuItem objects |
RestaurantMenu is an embedded value object containing the collection of MenuItem entries. Each MenuItem has a menu item ID, name, and price. The RestaurantService.create() method saves the aggregate and immediately publishes a RestaurantCreated event, ensuring downstream consumers receive the full menu at creation time.
The Restaurant Service does not itself participate in sagas — it is a source-of-truth publisher. The Order Service, Kitchen Service, and Delivery Service each maintain their own local read replicas of restaurant data by consuming
RestaurantCreated events.REST API
The service listens on port 8084. All endpoints are under the/restaurants path.
| Method | Path | Description |
|---|---|---|
POST | /restaurants | Register a new restaurant; returns { id } |
GET | /restaurants/{restaurantId} | Retrieve restaurant name and ID. Returns 404 if not found. |
Create restaurant request body
Get restaurant response body
Messaging
Events published
TheRestaurantDomainEventPublisher emits events on the net.chrisrichardson.ftgo.restaurantservice.domain.Restaurant channel:
| Event | Trigger | Consumers |
|---|---|---|
RestaurantCreated | New restaurant created via POST /restaurants; includes name, address, and full menu | Order Service, Kitchen Service, Delivery Service |
RestaurantMenuRevised | Menu is updated; includes revised menu items | Order Service |
The
RestaurantCreated event carries the restaurant’s Address, which the Delivery Service uses to populate its own restaurant pickup address table.Commands handled
The Restaurant Service does not handle any saga commands. It is a pure event publisher in the FTGO messaging topology.Database
The Restaurant Service uses MySQL. Key tables:| Table | Description |
|---|---|
restaurants | The Restaurant aggregate: ID, name, and embedded menu |
@ElementCollection embedded within the restaurant row, or as a collection table depending on the JPA mapping in RestaurantMenu. Transactional outbox messages for published events are written to the Eventuate Tram message table and relayed by the CDC service.