Backend Development 12 min read

Optimizing Offline Push Delivery in Xianyu's Messaging System

Xianyu improved its offline‑push delivery by fixing duplicate Agoo calls, using device IDs, classifying messages to avoid vendor quotas, prompting notification permissions, and personalizing timing and content, which raised the weak‑perception delivery rate by double‑digit percentages and set the stage for path tracing and infrastructure decoupling.

Xianyu Technology
Xianyu Technology
Xianyu Technology
Optimizing Offline Push Delivery in Xianyu's Messaging System

Background

Xianyu's messaging system connects buyers and sellers, enhancing trust and transaction success. The current issues include online message latency, low offline push delivery rate, and tight coupling between message features and the underlying system. Offline push delivery is the most critical problem.

Current State of the Messaging System

Strong Perception Path and Weak Perception Path

The strong perception path (both client and server online) consists of the sender client, idleapi‑message gateway, Heracles service, ACCS long‑connection channel, and the receiver client. Its key metrics are end‑to‑end latency and delivery rate.

The weak perception path handles offline users; delivery relies on offline push, so the main metric is delivery rate rather than latency. Currently the delivery rate is low.

Xianyu Messaging Architecture

Key components include HSF (internal Dubbo‑like RPC), Tair (distributed cache), Agoo (offline push middle‑platform), ACCS (long‑connection channel), Lindorm (NoSQL), and the domain ring (stores the latest 128 messages per user). Strong perception uses ACCS; weak perception uses Agoo.

Weak Perception Path Problem Analysis

The weak perception path suffers from four typical failure cases: token invalid or parameters wrong, push reaches device but not shown, push collapsed by the system, and push ignored by users. The core issue is low delivery rate.

What Is Weak Perception?

Weak perception refers to the offline push chain: Hermes (user reach system) → Agoo (offline push middle‑platform) → vendor channels (APNs, FCM, etc.) → device → user.

Weak Perception Chain Composition

Steps:

Step 1: Hermes creates the push request.

Step 2: Agoo receives the request.

Step 3: Agoo forwards the request to vendor channels (APNs, FCM, etc.).

Step 4: The vendor delivers the push to the device.

Step 5: User sees and clicks the push, opening Xianyu.

Key Problems

Whether the push reaches the user device.

Whether the user perceives the push.

The first stage—device delivery—is the primary focus for optimization.

Weak Perception Optimization

Agoo Acceptance Rate Optimization

Initially, only about half of the pushes reached Agoo because Xianyu called Agoo by user ID, causing duplicate calls for iOS and Android. By retrieving the exact device before calling Agoo and invoking Agoo with device ID, invalid calls were eliminated, raising the acceptance rate. Remaining failures were mainly due to users disabling notification permissions or missing device mappings.

Further improvements include prompting users to enable notifications and building a shared device registry with Agoo.

Vendor Acceptance Rate Optimization

Vendor channels impose quotas per app. Xianyu’s pushes were treated as marketing messages and hit these limits, causing many pushes to be blocked. By classifying pushes (instant messaging, order status, user follow, marketing) and marking them accordingly, as well as suppressing low‑interest pushes, the quota‑related blocks were eliminated.

Push Click Optimization

Two user‑experience issues were addressed: splash ads appearing after push clicks and permission checks blocking marketing pushes after login changes. The solution added a click‑through ad capability and relaxed permission checks for marketing pushes while keeping them for privacy‑sensitive messages.

Additionally, push timing and content are now personalized: algorithms select optimal delivery times based on user activity and perform real‑time A/B testing of push materials to increase click‑through rates.

Optimization Results

After addressing the bottlenecks, the overall delivery rate improved by double‑digit percentages.

Future Plans

Message path tracing.

Ensuring fast IM delivery.

Decoupling message features from underlying infrastructure.

Mapping users to devices for offline push.

Subsequent articles will explore these topics in depth.

AlibabaPerformanceXianyubackend optimizationmessaging systemnotification deliveryoffline push
Xianyu Technology
Written by

Xianyu Technology

Official account of the Xianyu technology team

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.