Skip to content

aleemulhaq/order_orchestrator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WMG Order Orchestrator

A Java-based order orchestration client that processes orders asynchronously through an asset generation and metadata generation pipeline.

Architecture

The solution implements a robust order orchestration system with:

  • HTTP-based communication with a mock server
  • Asynchronous asset and metadata generation with polling
  • Retry logic for transient server failures
  • Proper error handling for business logic failures

Pipeline flow:

  1. Take order from queue
  2. Queue asset generation → poll for completion
  3. Queue metadata generation → poll for completion
  4. Submit as SHIPPABLE (success) or FAILED (with appropriate data)

Setup & Run

Prerequisites

  • Java 11+
  • Maven 3.6+
  • Python 3.9+ (for mock server)

Terminal 1: Start Mock Server

pip install flask
python mock_server.py

Terminal 2: Run Order Orchestrator

mvn clean compile
mvn exec:java -Dexec.mainClass="Solution"

The application will process all orders in the queue, then exit gracefully.

Design Notes

  • Retry Logic: Automatic retry on 5xx errors (transient failures) with exponential backoff
  • Business Logic Failures: Asset/metadata generation failures are not retried (legitimate failure states)
  • Data Handling: Failed orders include asset data only if assets succeeded (per business rules)

Excalidraw Diagram

https://excalidraw.com/#room=e7d46ce920c75c73b992,g1WE-6toUenSIco62hKZMw

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors