1. Home
  2. Docs
  3. Current
  4. Guides
  5. Event queues

Event queues

Event queue anatomy

A event queue is a series of events with unknown beginning and ending. Therefore to facilitate the use of event queue, we need to slice the queue into digestible “chunks”. We use “acknowledgement” action to do this.

Future     Event flows into the queue                           Past
           ───────────────────►
┌──┐
│26│       ┌──────────────────────────────────────────────────┐
└──┘  ┌──┐ │                                                  │
      │25│  ┌──┐  ┌──┐  ┌──┐  ┌──┐  ┌──┐  ┌──┐  ┌──┐  ┌──┐  ┌─┴┐  ┌──┐  ┌──┐
      └──┘  │24│  │23│  │20│  │19│  │18│  │17│  │16│  │15│  │12│  │  │  │  │
            └──┘  └──┘  └▲─┘  └──┘  └──┘  └──┘  └──┘  └──┘  └─┬┘  └──┘  └──┘
           │             │                                    │
           └─────────────┼────────────────────────────────────┘
                         │   7 DAYS RETENTION
           ◄─────────────┼────────────────────────────────────►   ◄────────►
                         │                CONSUMED EVENTS
                         │◄───────────────────────────────────►     DELETED
                         │
                         You sent the acknowledgement here.

                         Then you will only get events
                         from 21 to the future.

                         We will not return older events 
                         from 20 to the past.

Event queue workflow

This is how your app will basically work with event queue system, regardless public app or in-house app.

  • Public app can subscribe a queue to multiple events of multiple sellers
  • In-house app can only subscribe a queue to multiple events one seller
                ┌───────────────┐         1. Create queue             ┌────────────┐
                │               │ ◄────────────────────────────────── │            │
                │ Open Platform │                                     │ Public App,│
                │               │ ──────────────────────────────────► │ Inhouse App│
                │               │          3. Queue X code            │            │
                │               │                                     │            │
          ┌─────┤               │     4. Subscribe Queue X to         │            │
          │     │               │       Seller A order updates,       │            │
          │     │               │       Seller B order updates        │            │
6. Route  │     │               │  ◄───────────────────────────────── │            │
  order   │     │               │                                     │            │
  events  │     │               │  ─────────────────────────────────► │            │
  of A, B │     └───────┬───────┘             5. OK                   └───┬────────┘
  to X    │             │                                                 │    ▲
          │             │2. Create Queue X                                │    │
          │             │                                                 │    │
          ▼             │                                                 │    │
      seller A          ▼                                                 │    │
      order events ────────────┐    7. Pull events from X, every 60s      │    │
       ────────►     Queue     │ ◄────────────────────────────────────────┘    │
                       X       │                                               │
       ────────► ──────────────┘ ──────────────────────────────────────────────┘
      seller B                             8. Events from X
      order events
                 ──────────────┐
                     Queue     │
                       Y       │
                 ──────────────┘

Your app need to ACTIVELY pull events from queue. You can pull every 1 minute, 5 minutes… depend on your desired latency.

Event types

We support events related to

  • Order creation & updates
  • Product price & quantity updates

You can see the full list here.

Articles

Was this article helpful to you? Yes No 1

How can we help?

Leave a Reply

Your email address will not be published.