A Java-based order orchestration client that processes orders asynchronously through an asset generation and metadata generation pipeline.
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:
- Take order from queue
- Queue asset generation → poll for completion
- Queue metadata generation → poll for completion
- Submit as SHIPPABLE (success) or FAILED (with appropriate data)
- Java 11+
- Maven 3.6+
- Python 3.9+ (for mock server)
pip install flask
python mock_server.pymvn clean compile
mvn exec:java -Dexec.mainClass="Solution"The application will process all orders in the queue, then exit gracefully.
- 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)
https://excalidraw.com/#room=e7d46ce920c75c73b992,g1WE-6toUenSIco62hKZMw