Inventory Monitoring + WeCom Alerts: A Hands-On Guide to the Request-Message Push Strategy on Qeasy
What This Strategy Solves
A retail customer runs dozens of supply-chain sync strategies on Qeasy between two ERP systems. Manual monitoring meant issues surfaced only after downstream business felt the pain. We deployed Qeasy's Request-Message Push strategy to periodically pull strategy error details and forward them to a WeCom robot, turning firefighting into early warning.
Data Flow and Field Mapping
The strategy is a two-stage query-and-push pipeline:
| Stage | Platform | API | Purpose | Key Fields |
|---|---|---|---|---|
| Source | Qeasy internal | StrategySourceErrorDetail | Query error details within a time window for given strategy IDs | recentSeconds, ids, strategy_name, strategy_id, number, response_at |
| Middle layer | Qeasy integration platform | — | Pass source fields through to target | strategy_name, number, response_at |
| Target | Qeasy internal (WeCom channel) | WeChatRobotDetail | Compose alert message and push to WeCom robot | access_token, name, lessee_name, number, response_at, problem |
The source ids field accepts a comma-separated list of strategy IDs for batch pull. recentSeconds controls the incremental window—172800 seconds (48h) covers two inspection cycles. On the target side, template variables like {{strategy_name}}, {{number}}, {{response_at}} populate the alert card.
How to Configure on Qeasy
Source side
- API:
StrategySourceErrorDetail, type WebAPI, method POST, effect QUERY. - Map
numberto strategy name andidtoresponse_at; enableidCheckfor incremental de-duplication. - Declare
recentSeconds(int) andids(string, comma-separated) explicitly; disablebuildModel, enableautoFillResponse.
Target side
- API:
WeChatRobotDetail, type WebAPI, method POST, effect EXECUTE. - Manage
access_tokenvia Qeasy connection settings, never hard-code it. - Use template variables
{{strategy_name}},{{lessee.name}},{{number}},{{response_at}},{{problem}}so the WeCom message shows which strategy, which record, when, and what went wrong. - Qeasy's built-in "only push on non-empty error" mechanism keeps noise low.
Implementation Steps
We rolled this out in three phases:
- Incremental start: Week one, monitor only 3–5 core strategies (e.g., inventory sync, shop-to-partner mapping). Set
recentSecondsto 86400 (24h). - Full coverage: Week two, expand
idsto all active strategies; raiserecentSecondsto 172800. Source cron at3 3 * * *, target at0 9 * * *. - Steady-state scheduling: Source every 6 hours; target twice daily at 09:00 and 18:00. This is the classic "incremental + full coverage" pattern common among Qeasy customers.
Pitfalls and Lessons Learned
- Never hard-code
access_tokenin the strategy—store it in Qeasy's credential vault. - Don't overload
ids: too many IDs slow the source and may trigger throttling; group by business domain. - Always enable
idCheckonresponse_atto prevent duplicate alerts. - Align time zones: source returns UTC; format explicitly in the target template to avoid 8-hour confusion.
- Don't silently swallow empty responses: a "zero-error daily report" line item prevents the ops team from thinking the inspection died.
When to Use and When Not to
Use when: you have many parallel strategies needing unified ops alerting; your ops team uses WeCom robots; alert frequency is manageable (sub-minute pushes will spam the group). Don't use when: you need sub-second real-time alerting (use a dedicated APM); the channel isn't WeCom (other EXECUTE targets work but require field adjustments); single-strategy, single-tenant lightweight scenarios—Qeasy's built-in alerts suffice.