← Bütün Patternlər
🎼

Orchestration

Mərkəzi Dirijor (Orchestrator) hər servisi sıra ilə çağırır və prosesi tam nəzarətdə saxlayır — orkestri idarə edən kimi.

🎯
Nə üçün?

Mürəkkəb iş axınlarında (sifariş + ödəniş + göndərmə) addımların ardıcıllığını mərkəzi bir yer idarə edir. Debug-u çox rahatdır.

🆚
Choreography-dən fərqi

Choreography-də hər kəs öz qərarını verir. Orchestration-da isə hər kəs "Dirijor nə deyir?"ə baxır.

🛠️
Alətlər

Camunda, Temporal, Netflix Conductor, Apache Airflow, Spring State Machine.

İNTERAKTİV

Vizual İzah

Mərhələ {{ currentStep + 1 }}: {{ steps[currentStep].title }}

🎼
Orchestrator
💳
Payment
{{ s1Status.text }}
📦
Inventory
{{ s2Status.text }}
🚚
Shipping
{{ s3Status.text }}
JAVA

Kod Nümunəsi

OrderOrchestrator.java
@Service
public class OrderOrchestrator {

    public OrderResult processOrder(OrderRequest order) {
        // Orchestrator hər addımı ardıcıl idarə edir

        // 1. Payment
        PaymentResult payment = paymentService.charge(order);
        if (!payment.isSuccess()) return OrderResult.failed("Ödəniş uğursuz");

        // 2. Inventory
        InvResult inv = inventoryService.reserve(order);
        if (!inv.isSuccess()) {
            paymentService.refund(order);  // Compensation
            return OrderResult.failed("Anbarda yoxdur");
        }

        // 3. Shipping
        shippingService.dispatch(order);

        return OrderResult.success();
    }
}
✅ Üstünlükləri
  • Prosesin tam görünüşü — debug rahatdır
  • Xəta idarəsi (compensation) sadədir
  • İş axını asanlıqla dəyişdirilə bilər
⚠️ Riskləri
  • Orchestrator SPOF / bottleneck ola bilər
  • Tight coupling riski (orchestrator hər kəsi bilir)
  • Mürəkkəb axınlarda orchestrator çox böyüyər