Skip to content
Build 6ff80cd

Arena Product Event Sync

Arena outbound events drive one current Camel pipeline with three downstream uses: invalidate affected OMS product data, refresh component details in BatchStation, and upsert products and BOMs into Jackyun. cm-product-prc owns the schedule, orchestration, Service Bus fan-out, and downstream transformations; cm-product-sys owns the Arena API and session.

Current implementation — verified from source on 20 July 2026

This page describes the code path that exists now. Physical queue names and schedules are environment configuration, so the logical names below omit environment prefixes. Runtime configuration remains the source of truth.

Flow

sequenceDiagram
    participant PRC as cm-product-prc
    participant SYS as cm-product-sys
    participant Arena as Arena PLM
    participant ItemQ as arena-items queue
    participant DetailT as arena-items-details topic
    participant OMS as OMS subscription
    participant Batch as BatchStation subscription
    participant JY as Jackyun subscription

    Note over PRC: Scheduled job + ShedLock + DB enable flag
    PRC->>SYS: GET /arena/item-events
    SYS->>Arena: Get unreconciled outbound events
    Arena-->>SYS: Event GUIDs
    SYS-->>PRC: Pending events

    loop Each event, pages of 400
        PRC->>SYS: POST /arena/items (event GUID + page offset)
        SYS->>Arena: Get outbound-event items
        Arena-->>SYS: Item GUIDs
        SYS-->>PRC: Event items
        PRC->>ItemQ: Encrypted item page
    end

    ItemQ->>PRC: Consume encrypted item page
    PRC->>PRC: Decrypt and split into enrichment chunks
    loop Each chunk
        PRC->>SYS: POST /arena/item-spec
        SYS->>Arena: Run item + BOM export
        Arena-->>SYS: Specs, attributes, and BOMs
        SYS-->>PRC: Enriched item details
        PRC->>DetailT: Encrypted detail payload
    end

    par OMS subscriber
        DetailT->>OMS: Invalidate affected product cache entries
    and BatchStation subscriber
        DetailT->>Batch: Enrich and update component details
    and Jackyun subscriber
        DetailT->>JY: Upsert items, then eligible BOMs
    end

    PRC->>SYS: POST /arena/reconzilation per event item
    SYS->>Arena: Mark item reconciled

Processing stages

1. Poll outbound events

ArenaProcessServiceImpl.eventItemJob() is controlled in three places:

  • Spring schedules it with product-sys.arena.item-event.schedule.cron.
  • ShedLock uses the lock name arena_event_items, preventing two pods from running it at once.
  • The scheduled_job_config row named arena_event_items-job can disable the job without removing the cron.

The job asks cm-product-sys for pending Arena outbound events, then fetches each event's items in offsets of 400 until Arena returns an empty page.

2. Queue and enrich item pages

Each event page is encrypted and published to the configured arena-items Service Bus queue. A processor in the same cm-product-prc application consumes it, decrypts it, and splits the items according to array.split.size.

For every chunk, cm-product-prc calls cm-product-sys /arena/item-spec. The system service creates an Arena export run and downloads the resulting item-spec and single-level BOM data. The enriched response is encrypted and published to the arena-items-details topic.

3. Fan out the detail payload

Three independently configured subscriptions consume the same detail payload:

Consumer Selection and transformation Destination
OMS Selects NAV-integrated items and computes the SKU set that needs invalidation. Top-level assemblies are included; matching standalone/BOM component SKUs are included. cm-osor-sys product-invalidation endpoint
BatchStation Selects items with BOMs whose Jackyun Integration attribute is Yes, fetches each component from Arena to add its name and revision, then builds the component-detail update. If a lookup fails, the component remains in the update but its name/revision can be null. Configured Batch API component-update endpoint
Jackyun Keeps items whose Jackyun Integration attribute is Yes, maps Arena attributes to Jackyun fields, and sends item upserts in configured batches. BOM updates are built only when BOM Needed in Jackyun? is Yes; BOM material entries are retained only when that component SKU appears in a successful item-upsert response. cm-jackyun-sys item and BOM endpoints

All Service Bus bodies in this path are encrypted. X-B3-TraceId and X-B3-SpanId travel as message application properties and HTTP headers.

4. Reconcile the Arena event

After cm-product-prc has published all enriched chunks, it calls the existing /arena/reconzilation endpoint once per event item. cm-product-sys turns that into Arena's item-level reconciliation request.

The misspelling reconzilation is part of the current internal endpoint and configuration contract. Do not silently “fix” it in one service.

Manual Jackyun resync

cm-product-prc also exposes POST /jackyun/resync for an explicit SKU list, capped at 50 SKUs per request. This path:

  1. Fetches each requested item directly from Arena.
  2. Fetches BOM components when the parent requires a Jackyun BOM.
  3. Keeps components enabled for Jackyun integration.
  4. Reuses the normal item-upsert and BOM-upsert transformation.
  5. Returns OK or a root-cause failure string per requested SKU.

This is an operational recovery path; it does not create or enable the scheduled event job.

Reliability notes

Arena reconciliation happens before subscriber success is known

The publisher reconciles Arena items after sending the enriched payload to the detail topic. It does not wait for the OMS, BatchStation, or Jackyun subscribers to finish. A downstream failure therefore does not make the item reappear in Arena's outbound-event poll.

Consumer exceptions are absorbed by the callbacks

The current Service Bus callbacks catch processing exceptions and log them without rethrowing or explicitly abandoning/dead-lettering the message. The older migration document's proposed Teams alerts, partial-failure queue, and ten-attempt retry flow are not implemented here and must not be described as current behavior.

Other operational details:

  • Arena session acquisition and caching live in cm-product-sys; callers never send Arena credentials.
  • The schedule, queue/topic entities, APIM destinations, batch sizes, and credentials all come from runtime configuration.
  • Jackyun product/SKU/BOM sync is the live production lane. The separate Jackyun order poller is built but disabled in production.

Code map

Responsibility Current implementation
Schedule, pagination, enrichment publish, reconciliation cm-product-prcArenaProcessServiceImpl
Service Bus consumers cm-product-prcServiceBusReceiverConfiguration
OMS and BatchStation routes cm-product-prcOMSIntegrationRouter, BatchingIntegrationRoute
Jackyun mapping and upserts cm-product-prcJackyunProcessServiceImpl, JackyunProessRoute
Arena REST facade, token, exports, reconciliation cm-product-sysArenaController, ArenaServiceImpl, ArenaAPIRouter