본문으로 건너뛰기
cccskills
무료GitHub에 공개

scheduler

AEM Cloud Service expert skill for Sling Scheduler. Routes to path-a.md (Runnable + OSGi properties) or path-b.md (Sling Jobs via JobManager). Covers classification, CS-specific constraints (no @SlingScheduled, multi-pod runOn, Boolean type hint), review checklist, troubleshooting fingerprints, and common pitfalls.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(3)

  • SKILL.md6.1 KB
  • path-a.md12.8 KB
  • path-b.md11.5 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Scheduler — AEM as a Cloud Service

Overview

Schedules in AEM CS must be declared as OSGi component properties — Scheduler.schedule() is not persisted across restarts. There is no @SlingScheduled annotation in the CS SDK.

Three properties control every scheduler:

PropertyRequired valueWhy
scheduler.expressionValid Quartz cron stringDeclares the trigger
scheduler.concurrent:Boolean=false:Boolean type hint requiredWithout the hint OSGi treats it as String and concurrent runs are not suppressed
scheduler.runOnSINGLE or LEADER for any write or external callDefault ALL fires on every publish pod simultaneously

Classification — choose before making any changes

Path A — Runnable + OSGi component properties when ALL are true:

  • Cron is a hardcoded constant or single @AttributeDefinition-backed value
  • Only one schedule per class
  • Class implements Runnable
  • No ScheduleOptions.config(), no per-execution job payload

→ Read path-a.md and follow its steps.

Path B — Sling Jobs via JobManager when ANY is true in the legacy source:

  • Cron comes from runtime config (config.cronExpression())
  • Multiple cron expressions per class
  • Legacy code needs per-execution job data, config-driven scheduling, or a Scheduler + JobConsumer split
  • Business logic needs job context or properties at execution time
  • @Modified re-registers schedules with new config values

→ Read path-b.md and follow its steps.

One pattern per session. If the codebase has both kinds, fix one class at a time.


Review Checklist

Use the path-specific checklists in path-a.md and path-b.md for scheduler mechanics.

Cross-cutting checks:

  • The chosen path matches the source shape: Path A for a single hardcoded cron + Runnable; Path B for config-driven or multi-schedule legacy code
  • No @SlingScheduled annotation
  • No scheduler.schedule(), scheduler.unschedule(), or scheduler.EXPR() calls in the migrated code
  • getServiceResourceResolver used — not getAdministrativeResourceResolver
  • ResourceResolver in try-with-resources — not stored as a field
  • OSGi DS R6 annotations (org.osgi.service.component.annotations) — no Felix SCR
  • Service user subservice name matches a ServiceUserMapperImpl.amended config

Path A checks:

  • scheduler.expression is a valid Quartz cron string (6 or 7 fields)
  • scheduler.concurrent:Boolean=false present with the :Boolean type hint
  • scheduler.runOn=SINGLE or LEADER set when the job writes to repo or calls external systems

Path B checks:

  • The job topic constant is shared between the Scheduler and JobConsumer classes
  • Job properties are read with job.getProperty("key", Type.class)
  • JobResult.OK, FAILED, or CANCEL is returned from the consumer

Troubleshooting

SymptomLog to searchFix direction
Scheduler never fires after deploymentnone (silent)Inspect the component's runtime state: if UNSATISFIED, the cause is usually a missing config or a misspelled config field name (scheduler_expression() in Path A, cronExpression() in Path B); if ACTIVE but no executions, the cron property name is misspelled or scheduler.expression is invalid
Fires N times per trigger (N = pod count)noneAdd scheduler.runOn=SINGLE to @Component property array
Two instances run simultaneouslynoneAdd scheduler.concurrent:Boolean=false — the :Boolean type hint is mandatory
Stops firing with no code change; unrelated workflows also stallRejectedExecutionException in sling-default pool entriesThread pool starvation — see diagnosis below

Thread pool starvation root cause chain:

  1. A scheduler makes a blocking call (HTTP/LDAP/DB) without a read timeout
  2. scheduler.concurrent missing/true → new thread per trigger
  3. All ApacheSlingdefault threads stuck
  4. block policy=ABORT silently rejects new submissions — no log, no execution

Diagnose: Developer Console → Thread Pool → ApacheSlingdefault → check active count vs max pool size and block policy. Fix: add HTTP read timeout to the blocking scheduler; set scheduler.concurrent:Boolean=false; change block policy to RUN via OSGi config in Git.


Common Pitfalls

@SlingScheduled used — the annotation does not exist in the CS SDK; class compiles but schedule is never registered (silent failure).

scheduler.schedule() in @Activate — dynamic registration is not persisted across restarts; schedule disappears on next deployment.

Missing scheduler.runOn on a write-side scheduler — default ALL fires on every publish pod; 3 pods = 3× the JCR writes / external calls per trigger.

Static ResourceResolver field — closed by the repo after idle timeout; subsequent run() invocations throw ClosedResourceResolverException.

scheduler.concurrent=false without :Boolean type hint — OSGi treats it as String, concurrent execution is not suppressed.


Modern Alternatives

RequirementUse
Stateless periodic task, missed runs on restart OKSling Scheduler — Path A
Config-driven cron or multiple schedulesSling Jobs — Path B
Task must survive instance restartSling Jobs (JobManager.createJob().schedule().cron())
Exactly-once across entire clusterSling Jobs + JobConsumer
Automatic retry on failureSling Jobs (retry per queue config)
Per-execution parametersSling Jobs (JobBuilder.properties())
Event-driven + time-drivenSling Jobs (triggered by both addJob() and schedule())

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Analyzes a multi-step conversion funnel to find where visitors drop off and which steps have the worst leakage. Use this skill when someone describes a journey and asks about conversion rates, drop-off, fallout, or step completion. Trigger for "analyze our checkout funnel," "where are visitors dropping off," "what's our add-to-cart to purchase conversion rate," "funnel analysis," "show me fallout between steps," or "which step loses the most visitors."

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aemgdc/aemdev22026년 10월 18일 업데이트

Generates a concise, executive-ready performance summary covering key metrics, trends, and what's driving movement. Use this skill when someone needs to produce a briefing, executive summary, performance narrative, or stakeholder readout — for example, "write an exec summary of last week's performance," "create a performance briefing for our leadership team," "produce a monthly business review summary," "what should I tell executives about our metrics," or "generate a performance narrative." Also trigger for "QBR summary," "weekly business review," or "stakeholder briefing."

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aemgdc/aemdev22026년 10월 18일 업데이트

Produces a compact KPI digest showing how key metrics changed over a period and what's driving the movement. Use this skill when someone asks for a performance summary, a weekly recap, a morning briefing, a KPI update, or any variation of "how did we do this week/month." Also trigger for "give me a performance overview," "what moved in the last 7 days," "pull our AA KPI report," or "summarize our metrics."

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aemgdc/aemdev22026년 10월 18일 업데이트

Compares the performance of two or more audience segments across key metrics side by side. Use this skill when someone wants to compare audiences or visitor groups — for example, "how do mobile visitors compare to desktop on conversion," "compare new vs. returning visitors," "show me the difference between these two segments," "compare these audiences on our KPIs," or "which segment performs better." Also trigger for "segment comparison" or "audience comparison."

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aemgdc/aemdev22026년 10월 18일 업데이트

Identifies which items (pages, campaigns, products, channels, regions) had the biggest increases or decreases for a key metric between two time periods. Use this skill when someone asks "what's up and what's down," "which campaigns moved the most," "top gainers and losers," "what pages are trending," "show me what changed by channel," or any variation of identifying the biggest movers and decliners for a metric.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aemgdc/aemdev22026년 10월 18일 업데이트

Scan an AEM Edge Delivery Services page for WCAG 2.1 AA accessibility violations and generate specific fixes. Identifies missing alt text, heading hierarchy issues, link text problems, color contrast concerns, and EDS-specific accessibility patterns. Use when fixing accessibility issues, preparing for compliance audits, or remediating WCAG violations.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aemgdc/aemdev22026년 10월 18일 업데이트

aemgdc의 스킬 모두 보기

이 스킬의 문제 신고