All posts · OIC Integrations

Pub/Sub Integration Patterns in OIC

Event-driven architectures using publish/subscribe patterns in OIC — using Oracle Streaming, ATP queues, and OIC's native event triggers for decoupled integrations.

Anurag Jangra · March 15, 2026 · 7 min read · ... views

Why pub/sub matters

Tightly-coupled point-to-point integrations create fragile architectures:

graph LR
    A[Fusion ERP] -->|direct call| B[System B]
    A -->|direct call| C[System C]
    A -->|direct call| D[System D]
    style A fill:#1e3a5f,stroke:#3B82F6,color:#e2e8f0
    style B fill:#1e293b,stroke:#475569,color:#e2e8f0
    style C fill:#1e293b,stroke:#475569,color:#e2e8f0
    style D fill:#1e293b,stroke:#475569,color:#e2e8f0

If System B is down, System A fails. Adding System E means changing System A.

Pub/Sub solves this:

graph LR
    A[Fusion ERP] -->|publish event| Q[(Oracle Stream)]
    Q -->|subscribe| B[System B]
    Q -->|subscribe| C[System C]
    Q -->|subscribe| D[System D]
    Q -->|subscribe| E[System E - new!]
    style A fill:#1e3a5f,stroke:#3B82F6,color:#e2e8f0
    style Q fill:#1e293b,stroke:#F59E0B,color:#e2e8f0
    style B fill:#0f2d1f,stroke:#22C55E,color:#e2e8f0
    style C fill:#0f2d1f,stroke:#22C55E,color:#e2e8f0
    style D fill:#0f2d1f,stroke:#22C55E,color:#e2e8f0
    style E fill:#0f2d1f,stroke:#22C55E,color:#e2e8f0

The publisher doesn’t know or care who’s listening.

OIC pub/sub with Oracle Streaming

Publisher integration:

// OIC JavaScript Action — build the event payload
var event = {
  eventType: "OrderCreated",
  eventTime: new Date().toISOString(),
  correlationId: input.orderId,
  payload: {
    orderId: input.orderId,
    customerId: input.customerId,
    amount: input.amount,
    currency: input.currency
  }
};
return JSON.stringify(event);

Subscriber integration trigger — configure the Oracle Streaming trigger in OIC:

Trigger: Oracle Streaming
  Stream: orders-events
  Partition Key: orderId  ← ensures ordering per order
  Consumer Group: order-processor
  Batch Size: 50
  Polling Interval: 30s

OIC Event Framework — native pub/sub

OIC itself can raise integration events that trigger other integrations simultaneously:

sequenceDiagram
    participant T as Trigger (REST/Schedule)
    participant I1 as Integration: Create PO
    participant OIC as OIC Event Bus
    participant I2 as Integration: Notify Approver
    participant I3 as Integration: Update Inventory

    T->>I1: invoke
    I1->>OIC: raise "PO_CREATED" event
    par Event Subscribers
        OIC->>I2: trigger (send notification)
    and
        OIC->>I3: trigger (reserve stock)
    end
    Note over OIC: Both subscribers fire in parallel

Dead-letter handling pattern

Every pub/sub implementation needs a plan for failed messages:

flowchart TD
    S[(Stream)] --> SUB[Subscriber Integration]
    SUB --> PROC{Processing OK?}
    PROC -->|Yes| DONE[✓ Commit offset]
    PROC -->|No, retry 1| R1[Retry after 30s]
    R1 --> PROC
    PROC -->|No, retry 2| R2[Retry after 5min]
    R2 --> PROC
    PROC -->|No, max retries| DLQ[(Dead Letter Queue)]
    DLQ --> ALERT[Alert OIC Admin]
    DLQ --> REPROCESS[Manual Reprocess Integration]

    style DONE fill:#0f2d1f,stroke:#22C55E,color:#e2e8f0
    style DLQ fill:#2d0f0f,stroke:#EF4444,color:#e2e8f0
    style ALERT fill:#2d0f0f,stroke:#EF4444,color:#e2e8f0

Ordering considerations

Oracle Streaming partitions by a key. Messages within a partition are ordered. Use the entity ID as the partition key to ensure all events for the same order are processed in sequence:

// OIC Publish action configuration
{
  "partitionKey": "$body.orderId",  // same order → same partition → ordered
  "messageKey": "$body.correlationId",
  "value": "$body"
}

Think Beyond the Implementation

Questions worth sitting with after reading this

01

Why is this architecture appropriate for this specific context — and where would it be the wrong choice?

02

What assumptions did we make that aren't stated explicitly? What happens if those assumptions are wrong?

03

What would break first if the requirements changed — volume doubled, a third system was added, or the deadline halved?

04

What alternatives did we reject, and why? Was the decision made on evidence — or habit?

AJ
Anurag Jangra
Oracle Cloud PaaS Consultant · OIC & VBCS Specialist

4.5+ years delivering enterprise Oracle Cloud integrations and VBCS applications across manufacturing, IT services, and financial sectors. OCI Certified — writes about real-world OIC, VBCS, SQL, and BI Publisher patterns from production experience.

Chat on WhatsApp