Skip to content

06 PLAN

Brian Lehnen edited this page Apr 8, 2026 · 1 revision

phase: 03-transports plan: "6" wave: 2 dependencies: ["1"] must_haves:

  • LiteDbTransport.md connection string does not contain unescaped \t
  • LiteDbTransport.md consumer code uses ILogger pattern
  • LiteDbTransport.md links to ConsumerMethod (not ConsumerLinq)
  • LiteDbTransport.md includes one-liner link to MessageHistory
  • LiteDbTransport.md links to samples repo
  • LiteDbOptions.md documents ALL properties including fixed/immutable ones
  • LiteDbQueueCreationOptions.md documents EnableHistory, clarifies EnableStatusTable default files_touched:
  • LiteDbTransport.md
  • LiteDbOptions.md
  • LiteDbQueueCreationOptions.md tdd: false

Plan 6 -- LiteDb Transport Family

Wave 2 -- Transport pages. Depends on Plan 1 (Transports overview). Can run in parallel with Plans 2-5, 7.


Task 1: Fix LiteDbTransport.md connection string, logging, features, and cross-references

Update `LiteDbTransport.md` with these changes:
  1. Connection string (line 24): Verify the connection string does not contain an unescaped \t that would render as a tab character. The current page has:

    var connectionString = @"Filename=c:\temp\queue.db;Connection=shared;";

    The @ verbatim string prefix prevents \t from being interpreted as a tab. This is correct as-is. However, verify that the raw markdown source does not have a literal tab character. If the markdown was corrupted and contains a literal tab between c: and emp, fix it to c:\temp\queue.db.

  2. Consumer HandleMessages method (lines 75-78): The current code already uses notifications.Log.LogDebug(...) which is the correct MEL ILogger pattern. Verify this is retained.

  3. Feature list (lines 3-10): The current list includes Delayed messages, Message expiration, Status based queues, Routing, and History tracking. It already notes Priority is not supported. Verify this is accurate. Add "Heartbeat (always on)" to the list since LiteDb always has heartbeat enabled.

    Updated list:

    • Delayed messages
    • Message expiration
    • Heartbeat (always enabled)
    • Routing
    • History tracking
    • Status tracking (always enabled)

    Priority is not supported by the LiteDb transport.

  4. Cross-references: Add after the consumer code sample:

    For more consumer patterns, see [ConsumerMethod](https://github.com/blehnen/DotNetWorkQueue/wiki/ConsumerMethod) and [ConsumerAsync](https://github.com/blehnen/DotNetWorkQueue/wiki/ConsumerAsync).
    
    If history tracking is enabled, see [MessageHistory](https://github.com/blehnen/DotNetWorkQueue/wiki/MessageHistory) for retention and query options.
  5. Samples link: Add at the bottom:

    ###### Full samples
    
    See the [LiteDb samples](https://github.com/blehnen/DotNetWorkQueue.Samples/tree/main/Source/Samples/LiteDb) in the DotNetWorkQueue.Samples repository.

Do NOT change: Queue creation code, producer code.

bash -c 'grep -P "\t" /mnt/f/git/dotnetworkqueue.wiki/LiteDbTransport.md | grep -v "^:space:" | head -5; grep -i "DotNetWorkQueue.Logging.LogLevel|Log.Log(|ConsumerLinq" /mnt/f/git/dotnetworkqueue.wiki/LiteDbTransport.md; echo "exit: $?"' No unescaped tab in connection string context. No broken logging API. Links to ConsumerMethod, MessageHistory, and samples repo present.

Task 2: Expand LiteDbOptions.md with complete property documentation

Update `LiteDbOptions.md` to fully document `LiteDbMessageQueueTransportOptions`. The current page is mostly complete but should be expanded to match the format of other transport options pages.

Replace content with:

#### LiteDb Options

**NuGet package:** `DotNetWorkQueue.Transport.LiteDb`

**Options class:** `LiteDbMessageQueueTransportOptions`

**Namespace:** `DotNetWorkQueue.Transport.LiteDb.Basic`

##### Time source

The LiteDb transport uses the local machine's clock for all time-dependent operations (delayed processing, expiration, heartbeat). If consumers run on multiple machines sharing the same database file, their clocks should be synchronized.

##### Connection string

LiteDb requires shared connections. The connection string format is:

Filename=path/to/queue.db;Connection=shared;


##### Configurable options

These options are set at queue creation time and cannot be changed after the queue exists.

| Property | Type | Default | Notes |
|----------|------|---------|-------|
| `EnableDelayedProcessing` | `bool` | `false` | Messages can be scheduled for future processing |
| `EnableStatusTable` | `bool` | `false` | Separate table for queue status queries |
| `EnableRoute` | `bool` | `false` | Tag messages with a route string |
| `EnableMessageExpiration` | `bool` | `false` | Auto-remove unprocessed messages past expiry |
| `EnableHistory` | `bool` | `false` | Message lifecycle tracking |

When `EnableHistory` is `true`, the `HistoryOptions` property (type `HistoryTransportOptions`) controls retention:

| Property | Type | Default |
|----------|------|---------|
| `RetentionDays` | `int` | `30` |
| `MaxExceptionLength` | `int` | `4000` |
| `StoreBody` | `bool` | `false` |
| `TrackEnqueue` | `bool` | `true` |
| `TrackProcessing` | `bool` | `true` |
| `TrackComplete` | `bool` | `true` |
| `TrackError` | `bool` | `true` |
| `TrackDelete` | `bool` | `true` |
| `TrackExpire` | `bool` | `true` |
| `MonitorTime` | `TimeSpan` | `1 day` |

##### Fixed options

The following are hardcoded in the LiteDb transport and cannot be changed:

| Property | Fixed value | Notes |
|----------|-------------|-------|
| `EnablePriority` | `false` | Priority queuing is not supported |
| `EnableStatus` | `true` | Status tracking is always on |
| `EnableHeartBeat` | `true` | Crashed workers will have their messages recovered |

LiteDb does not support `EnableHoldTransactionUntilMessageCommitted`, `QueueType`, `AdditionalColumns`, or `AdditionalConstraints`. These properties are not present on the LiteDb options class.

See [MessageHistory](https://github.com/blehnen/DotNetWorkQueue/wiki/MessageHistory) for details on history tracking behavior.

Key changes from current:

  • Added NuGet package, class name, namespace header
  • Added connection string format note
  • Added HistoryTransportOptions sub-properties table
  • Added explicit note about missing features (HoldTransaction, QueueType, AdditionalColumns)
  • Structured with consistent table format matching other options pages
grep -c "EnableHistory\|HistoryOptions\|RetentionDays\|EnablePriority.*false\|EnableHoldTransaction.*not" /mnt/f/git/dotnetworkqueue.wiki/LiteDbOptions.md grep returns 5 or more matches. LiteDbOptions.md documents all configurable properties, fixed properties, HistoryTransportOptions, and explicitly notes which features are absent.

Task 3: Update LiteDbQueueCreationOptions.md with missing documentation

Update `LiteDbQueueCreationOptions.md` with these changes:
  1. EnableStatusTable section (lines 22-28): The default is false. Add this clarification:

    Defaults to `false`. Unlike relational transports, LiteDb does not auto-enable this when adding custom columns (LiteDb does not support additional columns).
  2. Heartbeat and Status sections (lines 9-19): These sections currently have no code samples because the features are always-on / fixed. Clarify this:

    - Heartbeat
    
    Heartbeat is always enabled for the LiteDb transport. If a worker dies, other workers will be able to dequeue the message. This cannot be disabled.
    
    - Status
    
    Status tracking is always enabled for the LiteDb transport. This allows the queue to rollback messages and recover from crashed workers. This cannot be disabled.
  3. EnableHistory section (lines 30-36): Already present and correct. Verify it exists.

  4. EnableRoute: Add after EnableMessageExpiration (or confirm it's described in the feature list):

    - Enable Route
    
    Tag messages with a route string. Consumers can filter to process only messages with a specific route.
    
    ```csharp
    createQueue.Options.EnableRoute = true;
    
    
  5. Cross-references: Add at the bottom:

    See [LiteDbOptions](https://github.com/blehnen/DotNetWorkQueue/wiki/LiteDbOptions) for the complete property reference.
    
    See [MessageHistory](https://github.com/blehnen/DotNetWorkQueue/wiki/MessageHistory) for history retention configuration.
  6. Typo fix: Fix "seperate" to "separate" if present.

Do NOT change: EnableDelayedProcessing or EnableMessageExpiration sections -- these are correct.

grep -c "EnableRoute|EnableHistory|MessageHistory|always enabled|cannot be disabled" /mnt/f/git/dotnetworkqueue.wiki/LiteDbQueueCreationOptions.md grep returns 4 or more matches. LiteDbQueueCreationOptions.md clarifies fixed features, documents EnableRoute, has EnableHistory, and links to MessageHistory.

Clone this wiki locally