-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
69 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,10 @@ | ||
namespace Snittlistan.Queue; | ||
public class MessageQueueProcessorSettings | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the MessageQueueProcessorSettings class. | ||
/// </summary> | ||
/// <param name="readQueue">Message queue to read from.</param> | ||
/// <param name="errorQueue">Message queue to use for error handling.</param> | ||
/// <param name="workerThreadCount">Number of processing threads.</param> | ||
/// <param name="autoCreateQueues">Automatically create queues.</param> | ||
public MessageQueueProcessorSettings(string readQueue, string errorQueue, int workerThreadCount, bool autoCreateQueues) | ||
{ | ||
ReadQueue = readQueue ?? throw new ArgumentNullException(nameof(readQueue)); | ||
ErrorQueue = errorQueue ?? throw new ArgumentNullException(nameof(errorQueue)); | ||
WorkerThreadCount = workerThreadCount; | ||
AutoCreateQueues = autoCreateQueues; | ||
} | ||
#nullable enable | ||
|
||
public string ReadQueue { get; } | ||
namespace Snittlistan.Queue; | ||
|
||
public string ErrorQueue { get; } | ||
|
||
public int WorkerThreadCount { get; } | ||
|
||
public bool AutoCreateQueues { get; } | ||
|
||
public override string ToString() | ||
{ | ||
return $"Read={ReadQueue}, Error={ErrorQueue}, Workers={WorkerThreadCount}"; | ||
} | ||
} | ||
public record MessageQueueProcessorSettings( | ||
string ReadQueue, | ||
string ErrorQueue, | ||
int WorkerThreadCount, | ||
bool AutoCreateQueues, | ||
bool DropFailedMessages); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-- only allow one unhandled published_task for each task_type at a time | ||
ALTER TABLE snittlistan.published_task ADD task_type INT NULL; | ||
CREATE UNIQUE INDEX published_task_task_type_idx ON | ||
snittlistan.published_task(task_type) | ||
WHERE | ||
handled_date IS NULL; |