Stock is wrong after a busy day or an outage
Updates made while a system was slow or offline were dropped, and nothing went back to send them.
Direct stock updates work until one system is slow or offline. The signs that it’s time for a queue, and what a queue fixes.
The simplest stock integration sends each change straight to every other system: a sale on the till reduces stock in the ERP, which pushes the new level to the web shop. That’s fine while every system is up and fast. When the web shop is slow during a sale, or the ERP is down for an update, those direct calls fail or time out. Changes are lost or applied late and in the wrong order, and stock drifts until someone notices an oversold product.
Stock is wrong after a busy day or an outage
Updates made while a system was slow or offline were dropped, and nothing went back to send them.
Tills slow down when the web shop is busy
Each sale waits for other systems to reply, so one slow system holds up the others.
Older levels overwrite newer ones
Two updates for the same product arrive out of order, and the stale figure wins.
You fix stock with a nightly full resync
A complete overwrite hides the gaps, but stock is wrong for most of the day in between.
A queue sits between the system where stock changes and the systems that need to know. The till or ERP records the change in the queue and carries on straight away. A separate process delivers each change, in order, to each system that needs it. If a system is down, its changes wait in the queue and are delivered when it comes back, so nothing is lost and nothing is retyped. The queue also shows how far behind each system is, which is the early warning you need.
Either send each movement, such as “sold 2”, in strict order, or send the latest level with a timestamp and ignore anything older.
Updates for one product must arrive in the order they happened; different products can be processed side by side.
A queue may deliver a message twice. Give each movement an ID so it’s only applied once.
A message that keeps failing, such as an unknown product code, moves to a holding area with the reason, so the rest keep flowing.
Not every business needs one. If you sell through one channel, stock changes slowly and a few minutes’ delay is harmless, a scheduled sync that sends recent changes every few minutes may be enough. For example: a wholesaler taking a handful of trade orders an hour can usually work from a five-minute sync. A queue earns its place when several channels sell the same stock, volumes spike, or an oversold item costs you a customer.
Tell us where you sell and which system holds your stock. A few lines are enough.