Repository navigation
PLAN 2.1
phase: 02-core-usage plan: "2.1" wave: 2 dependencies: ["1.1"] must_haves:
- Consumer.md code sample includes ConsumerQueueNotifications as second param to Start()
- Consumer.md logging uses Microsoft.Extensions.Logging ILogger methods (LogInformation, LogError, etc.)
- ConsumerAsync.md code sample includes ConsumerQueueNotifications as second param to Start()
- ConsumerAsync.md logging uses Microsoft.Extensions.Logging ILogger methods
- No page contains DotNetWorkQueue.Logging.LogLevel or Log.Log( pattern files_touched:
- Consumer.md
- ConsumerAsync.md tdd: false
Wave 2 -- Consumer pages. Depends on Plan 1.1 (sidebar renames complete). These two pages have the highest-severity findings: missing ConsumerQueueNotifications parameter on Start() and broken logging API.
`Consumer.md` was already partially updated in a prior session. Verify the current content is correct against the source API. The page should already have:
-
queue.Start<SimpleMessage>(HandleMessages, notifications)withConsumerQueueNotificationsas second param -
ConsumerQueueNotificationsconstructed with 6 callback delegates -
notifications.Log.LogDebug(...)/LogInformation(...)/LogError(...)pattern (MEL) -
IWorkerNotificationproperties table includingLogasILogger,MetricsasIMetrics,TracerasActivitySource - No references to
DotNetWorkQueue.Logging.LogLevelornotifications.Log.Log(pattern
If the current page already matches all 5 checks, no edits are needed -- just verify and move on.
If any check fails, apply these corrections:
- Start() signature must be:
void Start<T>(Action<IReceivedMessage<T>, IWorkerNotification> workerAction, ConsumerQueueNotifications notifications) - Handler signature must be:
private void HandleMessages(IReceivedMessage<SimpleMessage> message, IWorkerNotification notifications) - Logging must use:
notifications.Log.LogDebug(...),notifications.Log.LogInformation(...), etc. - Remove any
using DotNetWorkQueue.Logging;references - Ensure
using DotNetWorkQueue.Queue;andusing Microsoft.Extensions.Logging;are mentioned
Add a link to the samples repo at the bottom of the "Creating the queue" section if not present:
> For a complete working example, see [SQLServerConsumer](https://github.com/blehnen/DotNetWorkQueue.Samples) in the samples repository.
`ConsumerAsync.md` was already partially updated. Verify and correct the following:
-
Creation path: Uses
CreateConsumerQueueScheduler(queueConnection, factory)-- this is the scheduler-based async consumer. The page should show theSchedulerContainer+TaskScheduler+TaskFactorysetup pattern. -
Start() call: Must pass
ConsumerQueueNotifications:queue.Start<SimpleMessage>(Handle, notifications);
where
notificationsis constructed fromnew ConsumerQueueNotifications(...)with 6 callbacks. -
Handler signature: Must be
Func<..., Task>for the directIConsumerQueueAsyncpath, ORAction<...>for the scheduler-basedIConsumerQueueSchedulerpath. The current page uses the scheduler path, so the handler is:private void Handle(IReceivedMessage<SimpleMessage> m, IWorkerNotification n)
This is correct for
CreateConsumerQueueScheduler. -
Logging: Verify no
DotNetWorkQueue.Logging.LogLevelorLog.Log(pattern exists. If the cancellation example uses logging, it should usenotifications.Log.LogDebug("Cancel has been requested - aborting"). -
Scheduler dispose note: Verify the page mentions disposing the scheduler after all queues are disposed.
-
Add a note clarifying the distinction: "This page demonstrates the scheduler-based async consumer (
CreateConsumerQueueScheduler), which manages a thread pool viaTaskScheduler. For the lower-levelCreateConsumerAsyncAPI where you manage tasks yourself, the sameStart()pattern applies but the worker action must returnTask." -
Add samples link at the bottom of the "Creating the queue" section:
> For a complete working example, see [SQLServerConsumerAsync](https://github.com/blehnen/DotNetWorkQueue.Samples) in the samples repository.
**Create three new files and delete three old files.** Per CONTEXT-2.md decision: delete old files entirely, no redirect stubs.
A) Create ProducerMethod.md based on current ProducerLinq.md content with these changes:
- Title: "Producing Method Expressions" (not "Producing Linq statements")
- Remove the entire "Send a dynamic statement, expressed as a string" section (lines 13-17 of current ProducerLinq.md) --
LinqExpressionToRunis#if net48only, dead code on net8.0/net10.0 - Replace "Linq statement" with "lambda expression" or "method expression" throughout
- Replace "Unlike the POCO queues" with "Unlike the typed-message producer"
- Keep
CreateMethodProducer(queueConnection)creation code (already correct) - Keep all Send/SendAsync examples (lambda format is correct)
- Add samples link:
> For a complete working example, see [SQLServerProducerLinq](https://github.com/blehnen/DotNetWorkQueue.Samples) in the samples repository.
B) Create ConsumerMethod.md based on current ConsumerLinq.md content with these changes:
- Title: "Consuming Method Expressions" (not "Consuming Linq Statements")
- Replace "Linq" / "linq" with "method expression" or "lambda expression" throughout
- Opening line: link to
ConsumerMethodAsyncinstead ofConsumerLinqAsync - The code sample already uses
CreateConsumerMethodQueueSchedulerandqueue.Start(notifications)-- this is correct - Verify
ConsumerQueueNotificationsis present in the code sample (it is in current ConsumerLinq.md) - Replace "POCO queue" with "typed-message consumer"
- Remove any reference to dynamic LINQ or
LinqExpressionToRun - Verify logging uses MEL pattern (current page uses
logger.LogError,logger.LogWarning,logger.LogInformation-- these are correct) - Add samples link:
> For a complete working example, see [SQLServerConsumerLinq](https://github.com/blehnen/DotNetWorkQueue.Samples) in the samples repository.
C) Create ConsumerMethodAsync.md based on current ConsumerLinqAsync.md content with these changes:
- Title: "Consuming Method Expressions (Async)" (not "Consuming messages")
- Opening line: link to
ConsumerMethodinstead ofConsumerLinq - Replace all "Linq" / "linq" references with "method expression" or "lambda expression"
- The code sample already uses
CreateConsumerMethodQueueScheduler-- correct - Verify
ConsumerQueueNotificationsis present in the code sample (it is in current ConsumerLinqAsync.md) - Fix
factory.schedulertofactory.Scheduler(capital S) on lines 21-23 if not already fixed - Replace "When your linq statement finishes" with "When your method expression finishes"
- Add samples link:
> For a complete working example, see [SQLServerConsumerLinq](https://github.com/blehnen/DotNetWorkQueue.Samples) in the samples repository.
D) Delete old files:
rm ProducerLinq.mdrm ConsumerLinq.mdrm ConsumerLinqAsync.md
For any issues please use the GitHub issues