If the queue is empty, compact the journal when it reaches this size.
If this is false, when a queue is full, clients attempting to add another item will get an error.
If this is false, when a queue is full, clients attempting to add another item will get an
error. No new items will be accepted. If this is true, old items will be discarded to make
room for the new one. This settting has no effect unless at least one of maxItems
or
maxSize
is set.
Name of a queue to add expired items to.
Name of a queue to add expired items to. If set, expired items are added to the requested
queue as if by a SET
command. This can be used to implement special processing for expired
items, or to implement a simple "delayed processing" queue.
If true, don't actually store any items in this queue.
If true, don't actually store any items in this queue. Only deliver them to fanout client queues.
If false, don't keep a journal file for this queue.
If false, don't keep a journal file for this queue. When kestrel exits, any remaining contents in the queue will be lost.
Expiration time for items on this queue.
Expiration time for items on this queue. Any item that has been sitting on the queue longer
than this duration will be discarded. Clients may also attach an expiration time when adding
items to a queue, but if the expiration time is longer than maxAge
, max_Age
will be
used instead.
Maximum number of expired items to move into the expireToQueue
at once.
Set a hard limit on the number of bytes a single queued item can contain.
Set a hard limit on the number of bytes a single queued item can contain. An add request for an item larger than this will be rejected.
Set a hard limit on the number of items this queue can hold.
Set a hard limit on the number of items this queue can hold. When the queue is full,
discardOldWhenFull
dictates the behavior when a client attempts to add another item.
When the journal gets larger than this, set a checkpoint so that the journal may be compacted
during read-behind (when the queue size in bytes exceeds maxMemorySize
).
Keep only this much of the queue in memory.
Keep only this much of the queue in memory. The journal will be used to store backlogged items, and they'll be read back into memory as the queue is drained. This setting is a release valve to keep a backed-up queue from consuming all memory. Also, when the current journal file reaches this size, it is rotated.
Expiration time for the queue itself.
Expiration time for the queue itself. If the queue is empty and older than this value then we should delete it.
Set a hard limit on the number of bytes (of data in queued items) this queue can hold.
Set a hard limit on the number of bytes (of data in queued items) this queue can hold. When the queue is full, discardOldWhenFull dictates the behavior when a client attempts to add another item.
Name of the queue being configured.
How often to sync the journal file.
How often to sync the journal file. To sync after every write, set this to 0.milliseconds
.
To never sync, set it to Duration.MaxValue
. Syncing the journal will reduce the maximum
throughput of the server in exchange for a lower chance of losing data.
QueueBuilder produces QueueConfig objects and can resolve the QueueConfig against a parent QueueConfig, inheriting the parent's values wherever the QueueBuilder's defaults are left unmodified. The default queue (see KestrelConfig) inherits exclusively from the defaults in QueueBuilder. Master queues inherit from the default queue. Fanout queues inherit from their master queue.
When constructing a QueueBuilder, values may be overridden as follows:
import com.twitter.conversions.time._ new QueueBuilder() { name = "the_queue_name" maxItems = 100 maxAge = 1.day }
Objects are implicitly converted into SpecifiedValue instances. In the case of
maxAge
the Duration is also wrapped in an option (e.g.,Some(1.day)
).