Recover a failed Catalog rating projection
Investigate and compensate when Catalog cannot apply a feedback rating change because the Book is missing.
Trigger / Symptom & Blast Radius
Catalog APIServicev1.0.0Catalog APIInternal HTTP and gRPC service for Catalog product management, hybrid discovery, and authoritative book metadata. PublishesBookUpdatedRatingFailedIntegrationEventSubscribesCreatePublisher, UpdatePublisher +24APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs publishes Book rating update failedEventv1.0.0Book rating update failedIndicates that Catalog could not apply a feedback-created event because the referenced book was not found. Ownercatalog-experience-teamSchemaDiagramOpen docs on <code>bookworm.{env}.catalog.book-update-rating-failed</code>, or a created FeedbackEntityv1.0.0FeedbackRepresents an individual customer's rating and optional written review for a Catalog book.Ownercatalog-experience-teamOpen docs record in Rating APIServicev1.0.0Rating APIInternal HTTP and A2A gRPC service for collecting, listing, deleting, and summarizing customer feedback for Catalog book...PublishesFeedbackCreatedIntegrationEvent, FeedbackDeletedIntegrationEventSubscribesCreateFeedback, DeleteFeedback +3APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs fails to project onto a BookEntityv1.0.0BookCanonical sellable title in the product catalog, encapsulating descriptive metadata, pricing, stock availability, taxono...Ownercatalog-experience-teamOpen docs in Catalog APIServicev1.0.0Catalog APIInternal HTTP and gRPC service for Catalog product management, hybrid discovery, and authoritative book metadata. PublishesBookUpdatedRatingFailedIntegrationEventSubscribesCreatePublisher, UpdatePublisher +24APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs. Blast radius is limited to orphaned review cleanup for a missing book; never communicate this compensation to customers as a manual deletion.
Never delete feedback records by bookId alone. Compensation targets only the exact FeedbackId
reported by Book rating update failedEventv1.0.0Book rating update failedIndicates that Catalog could not apply a feedback-created event because the
referenced book was not found.
Ownercatalog-experience-teamSchemaDiagramOpen docs.
Pre-Flight Check
Capture FeedbackId, correlation ID, and <ENV> from the failure event, then verify whether <BOOK_ID> exists in Catalog APIServicev1.0.0Catalog APIInternal HTTP and gRPC service for Catalog product management, hybrid
discovery, and authoritative book metadata.
PublishesBookUpdatedRatingFailedIntegrationEventSubscribesCreatePublisher, UpdatePublisher +24APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs and query Rating DatabaseContainerv1.0.0Rating DatabaseAuthoritative Azure Cosmos DB system of record owned by the Reviews bounded context for customer feedback documents part...Ownercatalog-experience-teamDiagramOpen docs:
curl -sS -o /dev/null -w "%{http_code}\n" "https://<GATEWAY_HOST>/catalog/api/v1/books/<BOOK_ID>"SELECT c.id, c.bookId, c.rating, c.createdAt FROM c WHERE c.id = "<FEEDBACK_ID>";Quick Recovery Procedure
Confirm the book is actually missing
If the Catalog check returns
404 Not Found, the book is absent and compensation is valid. Continue to Step 2.If the Catalog check returns
200 OK, stop immediately. Do not delete the feedback record—this indicates a transient database or contract fault. Escalate to Catalog Experience TeamTeamCatalog Experience TeamStream-Aligned team owning BookWorm's product catalog, customer reviews, and storefront/backoffice discovery experience....Open docs.Inspect Kafka consumer lag and dead-letter queues
Check lag and DLQ depth across <code>bookworm.{env}.rating.feedback-create</code>, <code>bookworm.{env}.catalog.book-update-rating-failed</code>, <code>bookworm.{env}.catalog.dead-letter-queue</code>, and <code>bookworm.{env}.rating.dead-letter-queue</code>. Stream Rating APIServicev1.0.0Rating APIInternal HTTP and A2A gRPC service for collecting, listing, deleting, and summarizing customer feedback for Catalog book...PublishesFeedbackCreatedIntegrationEvent, FeedbackDeletedIntegrationEventSubscribesCreateFeedback, DeleteFeedback +3APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs logs for Cosmos DB or Redis errors:
Terminal window az containerapp logs show --name <SERVICE_NAME> --resource-group <RESOURCE_GROUP> --tail 150Run recovery through the standard compensation handler
Restore any unhealthy dependency (Rating DatabaseContainerv1.0.0Rating DatabaseAuthoritative Azure Cosmos DB system of record owned by the Reviews bounded context for customer feedback documents part...Ownercatalog-experience-teamDiagramOpen docs, Redis, or Kafka) and replay recoverable messages from <code>bookworm.{env}.rating.dead-letter-queue</code>. The compensation handler deletes the orphaned document and invalidates Rating CacheContainerv1.0.0Rating CacheNon-authoritative FusionCache and Redis caching layer owned by the Reviews bounded context for AI-generated book feedbac...Ownercatalog-experience-teamDiagramOpen docs without emitting Feedback deletedEventv1.0.0Feedback deletedIndicates that a customer feedback rating was deleted for a book. Rating API publishes this event so Catalog can remove ...Ownercatalog-experience-teamSchemaDiagramOpen docs.
Verification
Re-run the Rating DatabaseContainerv1.0.0Rating DatabaseAuthoritative Azure Cosmos DB system of record owned by the Reviews bounded context for customer feedback documents part...Ownercatalog-experience-teamDiagramOpen docs query for <FEEDBACK_ID> and confirm 0 documents are returned while DLQ depth stops growing:
SELECT VALUE COUNT(1) FROM c WHERE c.id = "<FEEDBACK_ID>";Expected output:
[0]Rollback / Escalation
- Rollback: Compensation deletes only confirmed orphaned reviews for
404books; if a book was restored, the customer must re-submit their review. - Escalation: Escalate
200 OKfalse-failure events or persistent DLQ errors to Catalog Experience TeamTeamCatalog Experience TeamStream-Aligned team owning BookWorm's product catalog, customer reviews, and storefront/backoffice discovery experience....Open docs.
Related documentation
- Customer Feedback Publication and ProjectionFlowv1.0.0Customer Feedback Publication and ProjectionRating API persists customer feedback in Cosmos DB and publishes an integration event; Catalog API updates the derived b...Ownercatalog-experience-teamView flowOpen docs — End-to-end review projection and compensation flow.
- ADR-003: Compensate feedback rejected by CatalogDecision Recordv1.0.0ADR-003: Compensate feedback rejected by CatalogRating removes feedback when Catalog reports that a feedback-created event referenced a missing book, and treats repeate...Ownercatalog-experience-teamOpen docs — Compensation decision record.