Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Sichere ProgrammierungWhat is Programming And How i can Enjoy it?(24.09.2026 um 11:54 Uhr)
Sichere ProgrammierungYou Don't Need Adobe Commerce Cloud to Survive Black Friday(24.09.2026 um 11:55 Uhr)
Malware / Trojaner / VirenBeyond Lazarus: Organization of DPRK cyber capabilities(24.09.2026 um 11:59 Uhr)
Malware / Trojaner / VirenBeyond Lazarus: Organization of DPRK Cyber Capabilities(24.09.2026 um 11:59 Uhr)
Malware / Trojaner / VirenThe fake worker threat and the rise of human infiltration(24.09.2026 um 11:59 Uhr)
Malware / Trojaner / VirenPolinRider Spreads Through Compromised GitHub Accounts and Packagist(24.09.2026 um 11:59 Uhr)
Malware / Trojaner / VirenWeaselBiscuit Strips BeaverTail and OtterCookie Down to Essentials(24.09.2026 um 11:59 Uhr)
Sichere ProgrammierungWhat is Programming And How i can Enjoy it?(24.09.2026 um 11:54 Uhr)
Sichere ProgrammierungYou Don't Need Adobe Commerce Cloud to Survive Black Friday(24.09.2026 um 11:55 Uhr)
Malware / Trojaner / VirenBeyond Lazarus: Organization of DPRK cyber capabilities(24.09.2026 um 11:59 Uhr)
Malware / Trojaner / VirenBeyond Lazarus: Organization of DPRK Cyber Capabilities(24.09.2026 um 11:59 Uhr)
Malware / Trojaner / VirenThe fake worker threat and the rise of human infiltration(24.09.2026 um 11:59 Uhr)
Malware / Trojaner / VirenPolinRider Spreads Through Compromised GitHub Accounts and Packagist(24.09.2026 um 11:59 Uhr)
Malware / Trojaner / VirenWeaselBiscuit Strips BeaverTail and OtterCookie Down to Essentials(24.09.2026 um 11:59 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Build a Minute-Based Job Scheduler in .NET 10 with WJb package

Here’s a polished DEV.to-ready article, based on your snippet and the console output you shared. I kept it concise and practical, with copy‑paste sections, clear explanations, and a troubleshooting guide. Build a Minute-Based J…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Here’s a polished DEV.to-ready article, based on your snippet and the console output you shared. I kept it concise and practical, with copy‑paste sections, clear explanations, and a troubleshooting guide.









Build a Minute-Based Job Scheduler in .NET 10 with WJb




Output when running:


Scheduler running in start of each minute. Await please...
DummyAction.InitAsync. jobMore={"cron":"*/1 * * * *","priority":2}
DummyAction.ExecAsync: Hello from DummyAction! at 06/12/2025 23:48:00
DummyAction.InitAsync. jobMore={"cron":"*/1 * * * *","priority":2}
DummyAction.ExecAsync: Hello from DummyAction! at 06/12/2025 23:49:00



If you’ve ever needed a lightweight, cron‑style scheduler in a .NET app—without pulling in a full-blown orchestrator—this post shows how to wire up a per-minute job scheduler using the WJb package, modern hosting, DI, and logging in .NET 10.



We’ll build a simple hosted app that:




  • Spins up a JobScheduler (cron-like timing).

  • Hands work off to a JobProcessor (execution pipeline).

  • Runs a demo DummyAction once per minute using */1 * * * *.









Why this approach?




  • ✔️ Minimal ceremony: Hosted service + DI + console logs.

  • ✔️ Extensible: Add more actions, priorities, payloads.

  • ✔️ Predictable timing: Cron expression support.

  • ✔️ Separation of concerns: Scheduler decides when, processor decides how, action decides what.









Project Setup



csproj (SDK-style):




<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="10.0.0" />
<PackageReference Include="WJb" Version="0.8.0-beta1" />
</ItemGroup>

</Project>







Note: The package name here is WJb (0.8.0-beta1). If you’re using a different feed or package id (e.g., UkrGuru.WJb), adjust accordingly.










The Full Program



This single-file example wires up DI, logging, the scheduler, and a demo action that prints a message at the start of each minute.




using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using System.Text.Json.Nodes;
using WJb;
using WJb.Helpers;

public class Program
{
static async Task Main(string[] args)
{
using var host = Host.CreateDefaultBuilder(args)
.ConfigureServices(services =>
{
// Processor settings for JobProcessor from package (reads IOptions<Dictionary<string, object>>)
services.Configure<Dictionary<string, object>>(cfg =>
{
cfg["MaxParallelJobs"] = 2;
});

services.AddTransient<DummyAction>();

// --- 1) Action configuration ---
// Map the action code "Dummy" for scheduler use.
var actionConfig = new Dictionary<string, ActionItem>(StringComparer.OrdinalIgnoreCase)
{
["Dummy"] = new ActionItem(
Type: typeof(DummyAction).AssemblyQualifiedName!, // robust type resolution
More: new JsonObject
{
["cron"] = "*/1 * * * *", // runs at the start of each minute
["priority"] = (int)Priority.Normal
})
};

services.AddSingleton(actionConfig);

// Register IActionFactory (implementation provided by the package or your own)
services.AddSingleton<IActionFactory, ActionFactory>();

// Register JobProcessor ONCE; expose as IJobProcessor & hosted service
services.AddSingleton<JobProcessor>();
services.AddSingleton<IJobProcessor>(sp => sp.GetRequiredService<JobProcessor>());
services.AddHostedService(sp => sp.GetRequiredService<JobProcessor>());

// Register JobScheduler hosted service
services.AddHostedService<JobScheduler>();
})
.ConfigureLogging(logging =>
{
logging.ClearProviders();
logging.AddConsole();
logging.SetMinimumLevel(LogLevel.Error); // reduce noise
})
.Build();

Console.WriteLine("Scheduler running in start of each minute. Await please...");

await host.RunAsync();
}
}

// ------------------------------
// Dummy action used by scheduler
// ------------------------------
public sealed class DummyAction(ILogger<DummyAction> logger) : IAction
{
private readonly ILogger<DummyAction> _logger = logger;
private JsonObject _jobMore = new();

public Task InitAsync(JsonObject jobMore, CancellationToken stoppingToken)
{
_jobMore = jobMore ?? new JsonObject();
Console.WriteLine("DummyAction.InitAsync. jobMore={0}", _jobMore.ToJsonString());
return Task.CompletedTask;
}

public Task ExecAsync(CancellationToken stoppingToken)
{
var message = _jobMore.GetString("message") ?? "Hello from DummyAction!";
Console.WriteLine("DummyAction.ExecAsync: {0} at {1}", message, DateTime.Now);
return Task.CompletedTask;
}
}












How it Works (Step by Step)




  1. Hosted App


    Host.CreateDefaultBuilder spins up DI, config, logging, and runs hosted services until shutdown.



  2. Action Registry (ActionItem)


    We register an action code "Dummy" mapped to DummyAction with More metadata:




    • cron: "*/1 * * * *" — run at the start of every minute.

    • priority: 2 — this demo uses Priority.Normal.



  3. Scheduler (JobScheduler)


    A hosted service that checks each configured action’s cron schedule and enqueues jobs when due.


  4. Processor (JobProcessor)


    Another hosted service that picks up enqueued jobs and executes their actions (with respect to MaxParallelJobs).



  5. Action Lifecycle (IAction)




    • InitAsync receives the jobMore payload (cron, priority, plus any custom fields like message).

    • ExecAsync performs the job’s core work (here, a console message).











Running It



Run the app from your terminal:




dotnet run






Expected console output (every minute):




Scheduler running in start of each minute. Await please...
DummyAction.InitAsync. jobMore={"cron":"*/1 * * * *","priority":2}
DummyAction.ExecAsync: Hello from DummyAction! at 06/12/2025 23:48:00
DummyAction.InitAsync. jobMore={"cron":"*/1 * * * *","priority":2}
DummyAction.ExecAsync: Hello from DummyAction! at 06/12/2025 23:49:00
...





Timing note: The cron */1 * * * * triggers near the top of the minute. Depending on the scheduler’s internal tick/rounding, you might see execution within the first few seconds of the minute.










Customizing the Action



Want to pass a custom message?



Just add it to More:




["Dummy"] = new ActionItem(
Type: typeof(DummyAction).AssemblyQualifiedName!,
More: new JsonObject
{
["cron"] = "*/1 * * * *",
["priority"] = (int)Priority.Normal,
["message"] = "Minute tick ✅"
})












Troubleshooting





  • No output each minute




    • Ensure the app is still running and not exiting (hosted services need the host alive).

    • Check your system time and timezone; cron matching is time-based.


    • Set logging to Information if you need more granularity:


      logging.SetMinimumLevel(LogLevel.Information);










  • Action not resolving




    • Verify typeof(DummyAction).AssemblyQualifiedName is not null and that the type is public.

    • Ensure you registered IActionFactory and DI knows how to construct the action.








  • Parallel execution concerns




    • Use cfg["MaxParallelJobs"] to control concurrency.

    • If your action touches shared resources, implement appropriate locks or idempotency guards.














Production Tips




  • Persisted Queues: For durability, integrate a backing store (DB) for jobs and their state.

  • Retries & Dead-letter: Add failure handling, exponential backoff, and DLQ semantics.

  • Metrics & Health: Expose Prometheus counters or IHealthCheck for scheduler/processor.

  • Graceful Shutdown: Respect CancellationToken in ExecAsync to stop cleanly.









Wrap-up



With a small amount of code, you can build a reliable, minute-based scheduler in .NET 10 using WJb. It cleanly separates responsibilities and remains flexible for real workloads—cron windows, priorities, parallel execution, and custom payloads are all first-class.

IoC Intelligence (1 Indikatoren)
dev[.]to
CTI Threat Relationship Graph3 Knoten / 2 Relationen
CVE / Incident Software MITRE ATT&CK CWE Weakness IoC
SOC Incident Playbook: Remote Code Execution (RCE) Defense
title: Detect Exploitation - Build a Minute-Based Job Scheduler in .NET 10 with WJb package
id: e846cfba-f2da-424d-b1bb-ff7f332e8a7d
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-24
logsource:
  category: network_connection
  product: any
detection:
  selection:
      DestinationHostname:
        - 'dev.to'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-24"
        description = "YARA Signature for "
    strings:
        $str = "Build a Minute-Based Job Sched" ascii wide
    condition:
        any of them
}
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Kognitive Analyse für identifizierte Bedrohung: Erhöhte Bedrohungslage im Bereich Build a Minute-Based Job Scheduler in .N.... Basierend auf 368k Vektor-Korrelationen werden sofortige Isolationsmaßnahmen für betroffene Endpunkte empfohlen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
🔗 Semantisch verwandte Zero-Days MariaDB 11.7 VEC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Build a Minute-Based Job Scheduler in .NET 10 with WJb package

Thematisch verwandte Begriffe: Build, MinuteBased, Scheduler, with · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-97152 | Nanomsg versions 0.5-beta through 1.x before 1.2.3 has a remotely exploi…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel TTP ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick