Repository navigation
SQLiteQueueCreationOptions
When you create a new SQLite queue, you can enable and disable various features. Most of these options change the schema of the queue. You must set all of these options before you create the queue. The database file can already exist. If it does not, the queue creator will create it at the location that the connection string specifies.
- Additional columns
You can add additional columns to the queue status table. When you send a message, you can then include data for these columns. The queue stores user columns on the status table.
Add a user-defined column named 'OrderID':
createQueue.Options.AdditionalColumns.Add(new Column("OrderID", ColumnTypes.Integer, true, null));Send user-defined data with a message. The dequeued message does not include this data.
var data = new AdditionalMessageData();
data.AdditionalMetaData.Add(new AdditionalMetaData<Int64>("OrderID", 1234));
queue.Send(message, data);- Additional constraints
Add an index on the OrderID column. Every column and index that you add degrades performance.
createQueue.Options.AdditionalConstraints.Add(new Constraint("OrderID_IX", ContraintType.Index, "OrderID"));- EnableDelayedProcessing
You can configure the queue to support delayed processing. If a queue does not need delayed processing, you can set this to false to increase performance. The retry behavior uses this option. If you disable it and enable retries, the queue does not delay the retries.
If this setting is false and you pass a delay with a message, the queue ignores the delay.
createQueue.Options.EnableDelayedProcessing = true;- Enable Heartbeat
You can configure the queue to support heartbeats. If a worker dies, other workers can dequeue the message. You cannot enable this option if the queue holds transactions.
createQueue.Options.EnableHeartBeat = true;- Enable Message Expiration
You can configure the queue to support message expiration. If a queue does not need expiration, you can set this to false to increase performance. RPC queues set this to true when they are created, even if you set it to false.
If this setting is false and you pass an expiration with a message, the queue ignores the expiration.
createQueue.Options.EnableMessageExpiration = true;- Enable Priority
You can configure the queue to support message priority. Priority lets you move messages to the front of the queue. Without priority, the queue behaves as a loose FIFO queue.
If this setting is false and you pass a priority with a message, the queue ignores the priority.
createQueue.Options.EnablePriority = true;- Enable Route
Tag messages with a route string. Consumers can filter to process only messages with a specific route.
createQueue.Options.EnableRoute = true;- Enable Status
You can enable a status column on the queue. If heartbeat is enabled, this option is required. The status column lets the queue roll back messages and recover from crashed workers.
If the status is disabled, the queue acts as a FIFO queue and cannot recover messages. This might be what you want if speed is important and you can accept the loss of some messages when a worker crashes, the power fails, or something similar happens.
createQueue.Options.EnableStatus = true;- Enable Status Table
The queue can create and update a separate table that you can query to see the status of the queue. This is safer than querying the queue itself, because a direct query can block operations and cause deadlocks.
If you add user columns to the queue, the queue enables this table automatically and stores the user columns in it.
createQueue.Options.EnableStatusTable = true;- Queue Type
There are three types of queues:
Normal
RPCSend
RPCReceive
For RPC, you need to create two queues: an RpcSend queue and an RpcReceive queue. When you run the RPC queue, you pass it both queues so that it knows where to write requests and where to listen for responses.
- Enable History
When this option is enabled, the queue creates a message history table. This table tracks message lifecycle events (enqueue, processing, complete, error, etc.). The default is false.
createQueue.Options.EnableHistory = true;- Enable Hold Transaction Until Message Committed
SQLite does not support this option. SQLite allows only one writer at a time, so a transaction held open during message processing blocks every other write to the queue, including the next dequeue. The SQLite options class does not expose the property, and the value is always false.
See SQLiteOptions for the complete property reference.
See MessageHistory for history retention configuration.
See UserDequeueColumns for using additional columns in dequeue queries.
For any issues please use the GitHub issues