Qeasy Cloud
Get Started

Practicing the Jky Combination Package Query Strategy: Moving Data from Source API to the Middle Layer

· 卢剑航· Integration Solutions· 32 views· 4 min read

What This Strategy Solves

Combination packages are common in retail and manufacturing: one SKU is made up of several sub-items, and its coding system differs from regular single items. In one real project we saw combination package data in the source system needing to be reused across multiple target systems. Pulling it in real time every time puts heavy pressure on the source and easily fragments data definitions. So the first step is usually to land combination package data reliably into a middle layer before distributing it further. This article focuses on that kind of query strategy: pulling combination package master data from the source endpoint erp-goods.goods.listgoodspackage, with Qeasy (the data integration platform) handling transport into the middle layer on a scheduled cadence.

Data Flow and Field Mapping

Data flow is unidirectional: source system (A) → Qeasy middle layer → downstream strategies consume it. The source-side strategy only "pulls data"; the target-side is configured as a no-op write trigger so the middle layer has a clear landing point, instead of writing straight into the target business system.

Key field mapping (only fields explicitly present in the source material; nothing is invented):

PurposeSource fieldMiddle layer fieldNotes
Pagination startpageIndexScheduler variable PAGINATION_START_PAGEIncremental start maintained by scheduler
Page sizepageSizeFixed 50One page per call to avoid large result timeouts
Business numbergoodsNonumberCombination package business code
Primary key IDgoodsIdidUsed for idempotency and deduplication
SKU identifierskuIdskuIdSub-item dimension inside the combination
NamegoodsNamegoodsNameUsed for display and reconciliation

Mapping principle: code mapping is centralized in the platform's mapping table, not scattered across strategies; only necessary header fields are transported here, and sub-item details are expanded by downstream consumer strategies.

How to Configure on Qeasy

In the Qeasy data integration platform, this is a typical query-only configuration:

  1. Create a strategy, direction "Source: Jky" → "Target: Qeasy middle layer", type QUERY_ONLY (query only, no direct write to target business system).
  2. On the source side pick the WebAPI endpoint erp-goods.goods.listgoodspackage, method POST, enable autoFillResponse so response fields are auto-populated into the response structure for easier mapping.
  3. Pagination: pageIndex references {{PAGINATION_START_PAGE}}, pageSize is fixed at 50; in incremental mode the platform auto-fills the page based on the last max ID.
  4. Primary key and number: set goodsNo as number, goodsId as id, enable idCheck for idempotency so the same combination package won't be written multiple times.
  5. Target side: pick the no-op write as the trigger node, so the middle layer has a definite execution result rather than bypassing the platform.
  6. Scheduling: source crontab is 0 0,12 * * * (daily at 00:00 and 12:00), target crontab is 23 2 * * * (02:23 daily), staggered to reduce pressure on the source.

Implementation Steps

We recommend a three-phase rollout instead of running all history at once.

  • Phase 1: Incremental start. Use a small batch first to validate mapping, set pageIndex to 1, run one full pagination pass, and confirm combination codes and sub-item dimensions land correctly in the middle layer.
  • Phase 2: Full trigger. Once verified, turn off incremental mode, manually trigger one full pull to backfill history.
  • Phase 3: Steady-state scheduling. Switch the source timer back to 0 0,12 * * * and the target timer to 23 2 * * *; configure failure retries and alerting.

Lessons Learned

  1. Treating a query strategy as a sync strategy. A typical mistake is writing query results straight into the target business system, polluting downstream documents. The safer pattern is QUERY_ONLY on the source, with downstream strategies doing the writing.
  2. Hard-coded pagination causing data loss. pageSize=50 is reasonable, but pageIndex must reference a variable; if hard-coded to 1 you only ever pull the first page.
  3. Wrong idempotency key. The primary key for a combination package should be goodsId, not skuId. skuId is finer-grained and would split the same combination package into multiple records.
  4. Source and target running at the same time. Overlapping crontabs cause "pull while write" behavior. Stagger them, e.g., source at 00:00 and 12:00, target at 02:23.
  5. Code mapping scattered everywhere. We have seen this on customer sites: every strategy maintains its own code mapping, and three months later the two sides do not match. The stable approach is to centralize mapping in Qeasy's mapping table for global reuse.

When This Applies and When It Does Not

Applies: combination package master data needs to be reused by multiple downstream systems and you want a unified data definition in a middle layer; on-premise deployment with sensitivity to source endpoint pressure.

Does not apply: scenarios that need to write combination packages into the target business system in real time and have them participate in document flow (use a SYNC strategy instead); scenarios where combination package fields change frequently and minute-level freshness is required (use event-triggered integration rather than scheduled query).

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-p2ea595-p4a143d-3954-nc22822f4-80ece382

Comments