AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified Apache-2.0 Self-run

Kora Aop Scheduling Jdk

skill-kora-projects-kora-skills-kora-aop-scheduling-jdk · by kora-projects

In-process scheduled tasks in Kora backed by the JVM ScheduledExecutorService, enabled via SchedulingJdkModule and the scheduling-jdk artifact. Covers @ScheduleAtFixedRate (fixed period, may overlap), @ScheduleWithFixedDelay (gap after completion, never overlaps), @ScheduleOnce (single delayed run), externalizing parameters through the config attribute, the scheduling config section (threads, shu…

No reviews yet
0 installs
25 views
0.0% view→install

Install

$ agentstack add skill-kora-projects-kora-skills-kora-aop-scheduling-jdk

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-kora-projects-kora-skills-kora-aop-scheduling-jdk)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
1mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Kora Aop Scheduling Jdk? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Kora AOP Scheduling (JDK)

Artifact: ru.tinkoff.kora:scheduling-jdk Module: SchedulingJdkModule Annotation package: ru.tinkoff.kora.scheduling.jdk.annotation.*

Aspect-driven scheduling on top of the JVM ScheduledExecutorService. The annotations mirror the scheduleAtFixedRate, scheduleWithFixedDelay, and schedule method signatures. No external scheduler, no persistence — jobs live only for the lifetime of the process. For cron, persistent state, custom triggers, or cluster-wide single execution, use the sibling skill [kora-aop-scheduling-quartz](../kora-aop-scheduling-quartz/SKILL.md).

Aspect requirement: the bearing class must be non-final (Java) / open (Kotlin), otherwise the annotation processor cannot generate the scheduling aspect.


Quick Start

1. Add dependency

All Kora artifacts inherit their version from the kora-parent BOM — never version individual ru.tinkoff.kora:* deps.

dependencies {
    koraBom platform("ru.tinkoff.kora:kora-parent:1.2.17")
    annotationProcessor "ru.tinkoff.kora:annotation-processors"   // mandatory — generates the aspect

    implementation "ru.tinkoff.kora:scheduling-jdk"
    implementation "ru.tinkoff.kora:config-hocon"
    implementation "ru.tinkoff.kora:logging-logback"
}

Kotlin uses ksp "ru.tinkoff.kora:symbol-processors" instead of annotationProcessor.

2. Plug the module into @KoraApp

@KoraApp
public interface Application extends
    HoconConfigModule,
    LogbackModule,
    SchedulingJdkModule {
}

3. Declare a scheduled component

package com.example.app.jobs;

import ru.tinkoff.kora.common.Component;
import ru.tinkoff.kora.scheduling.jdk.annotation.ScheduleAtFixedRate;
import java.time.temporal.ChronoUnit;

@Component
public class ScheduledJobs {   // non-final: required for aspect generation

    @ScheduleAtFixedRate(initialDelay = 30, period = 60, unit = ChronoUnit.SECONDS)
    void heartbeat() {
        // Lightweight task every 60 seconds
    }
}

JDK Annotations

| Annotation | Description | Overlap | |------------|-------------|---------| | @ScheduleAtFixedRate | Fixed interval regardless of execution time | Possible | | @ScheduleWithFixedDelay | Delay after previous completion | Never | | @ScheduleOnce | Single execution after delay | N/A |

@ScheduleAtFixedRate

Runs at fixed intervals. If task takes longer than period, next execution starts immediately after completion.

@ScheduleAtFixedRate(initialDelay = 30, period = 60, unit = ChronoUnit.SECONDS)
void heartbeat() {
    // Runs every 60s (may overlap if task > 60s)
}

@ScheduleWithFixedDelay

Waits for delay after task completion. No overlap possible.

@ScheduleWithFixedDelay(initialDelay = 30, delay = 60, unit = ChronoUnit.SECONDS)
void syncData() {
    // Completes → wait 60s → run again
}

@ScheduleOnce

Single execution after specified delay.

@ScheduleOnce(delay = 5, unit = ChronoUnit.MINUTES)
void warmup() {
    // Runs once after 5 minutes
}

Externalized parameters (config)

When the config attribute is set, the values come from that config path and override the annotation attributes (which then act only as defaults). The path is arbitrary; the example app nests jobs under scheduling.jobs.*.

@ScheduleAtFixedRate(config = "scheduling.jobs.heartbeat")
void heartbeat() { ... }
scheduling.jobs.heartbeat {
  initialDelay = "10s"
  period = "30s"
}

Keys per annotation: @ScheduleAtFixedRateinitialDelay, period; @ScheduleWithFixedDelayinitialDelay, delay; @ScheduleOncedelay. Durations accept HOCON time strings ("5ms", "30s", "2m").


Module configuration

Defaults shown match ScheduledExecutorServiceConfig:

scheduling {
  threads = 2                    # ScheduledExecutorService pool size (default: 2)
  shutdownWait = "30s"           # grace period for in-flight jobs on graceful shutdown
  telemetry {
    logging.enabled = false      # job execution logging (default: false)
    metrics.enabled = true       # Micrometer metrics (default: true)
    tracing.enabled = true       # OpenTelemetry tracing (default: true)
  }
}

See [scheduling-config-reference.md](references/scheduling-config-reference.md) for SLO buckets, metric tags, and tracing attributes.


Graceful Shutdown

Long-running jobs must check interrupt status:

@ScheduleWithFixedDelay(config = "scheduling.jobs.batch")
void processBatch() {
    while (!stopCondition()) {
        if (Thread.currentThread().isInterrupted()) {
            return;  // Exit on shutdown signal
        }
        doWork();
    }
}

Error Handling

Exception is logged, next invocation continues normally.

Pattern: Wrap in try-catch to prevent logging noise.

@ScheduleAtFixedRate(period = 60, unit = ChronoUnit.SECONDS)
void process() {
    try {
        doWork();
    } catch (Exception e) {
        log.error("Scheduled task failed", e);
    }
}

Common Pitfalls

| Problem | Solution | |---------|----------| | Task not running | Ensure class is @Component and non-final (Java) / open (Kotlin) | | Concurrent execution | Use @ScheduleWithFixedDelay instead of @ScheduleAtFixedRate | | Long-running task | Check Thread.currentThread().isInterrupted() for graceful exit | | Config not applied | Verify config path matches annotation |


References, assets, scripts

| File | Purpose | |------|---------| | [references/jdk-scheduling-reference.md](references/jdk-scheduling-reference.md) | Per-annotation reference, error handling, telemetry | | [references/scheduling-config-reference.md](references/scheduling-config-reference.md) | Full config reference (JDK + Quartz) | | [references/graceful-shutdown-reference.md](references/graceful-shutdown-reference.md) | Interrupt handling and shutdown patterns | | [references/quartz-scheduling-reference.md](references/quartz-scheduling-reference.md) | Cron/trigger reference (see sibling skill) | | [assets/ScheduledJobs.java.template](assets/ScheduledJobs.java.template) | Java scheduled-jobs starter | | [assets/ScheduledJobs.kt.template](assets/ScheduledJobs.kt.template) | Kotlin scheduled-jobs starter | | [scripts/setup-jdk.sh](scripts/setup-jdk.sh) | Add scheduling-jdk, template, and config to a project | | [scripts/validate-cron.sh](scripts/validate-cron.sh) | Inspect a Quartz cron expression (for the sibling skill) |

Source of truth: .kora-agent/kora-docs/mkdocs/docs/en/documentation/scheduling.md (section #native) and .kora-agent/kora-examples/examples/java/kora-java-scheduling-jdk.


Related skills

  • [kora-aop-scheduling-quartz](../kora-aop-scheduling-quartz/SKILL.md) — cron, triggers, persistent and clustered jobs
  • [kora-aop-logging](../kora-aop-logging/SKILL.md) — @Log / @Mdc for scheduled methods

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.