Glossary · Subscriptions

Discard oldest

DiscardOldest is the per-MonitoredItem boolean deciding which notification is thrown away when the queue is full. True, the usual default, discards the oldest entry and keeps the newest values. False discards the incoming notification and keeps the oldest. Either way a sample is lost and the overflow bit is set on the queue.

Which one to choose

True is right for anything where current state matters - HMI values, live trends, control feedback - because losing history is preferable to displaying a stale number. False is occasionally right when the first samples after an event are the interesting ones and the later ones are noise, for example capturing the leading edge of a fault. In practice almost every production configuration uses true.

The degenerate case: QueueSize 1

With a queue of one and DiscardOldest true you get classic last-value-wins behaviour: one value per publishing cycle, always the most recent. That is a perfectly sensible configuration for slow status tags and dashboards, and it is what most clients configure by default. It becomes a defect only when the sampling interval is faster than the publishing interval and the intermediate samples mattered.

There is no back-pressure

Neither setting slows the sampler or asks the client to catch up. OPC UA subscriptions drop rather than block, which is what keeps a slow client from stalling a server. If you cannot afford to drop samples, the answer is a bigger queue, a slower sampling interval or a deadband - not a different discard policy.

Example

Four samples into a queue of two

Samples arriving between publishing cycles: A B C D    QueueSize 2

  DiscardOldest = true    queue ends as [C, D]   A and B dropped, overflow bit set
  DiscardOldest = false   queue ends as [A, B]   C and D dropped, overflow bit set

Both lose two samples. The flag chooses which two, never whether.
The mistake people make: Reading DiscardOldest false as a safety setting that preserves data. It preserves the oldest data and discards the newest, which on a live value means your client keeps showing a number from the start of the cycle while the process has moved on - usually worse than the alternative, and still lossy.

Defined in: Part 4 - Services, CreateMonitoredItems and the queue overflow handling.

Status codes you will meet

Last verified 7 September 2026 against OPC UA 1.05.07. OPC UA Connect is an educational resource and is not affiliated with the OPC Foundation.

Free download
OPC UA Server Acceptance Test Pack
A 40-check acceptance test you run against a vendor's server before commissioning sign-off. Weighted scoring, three hard gates, and a one-page verdict for the supplier meeting.
Get the free test pack →
Free, no course, no login