René's URL Explorer Experiment


Title: Monitor Java scheduled jobs: Spring @Scheduled and Batch

Open Graph Title: Monitor Java scheduled jobs: Spring @Scheduled and Batch

X Title: Monitor Java scheduled jobs: Spring @Scheduled and Batch

Description: Java cron job monitoring: a Spring @Scheduled try/catch pings LastPing on success and /fail on exception; a Spring Batch listener covers batch steps.

Open Graph Description: Spring @Scheduled: try/catch that pings on success and /fail on exception. Spring Batch: JobExecutionListener for completed vs failed status. Free, no monitor cap.

X Description: Spring @Scheduled: try/catch that pings on success and /fail on exception. Spring Batch: JobExecutionListener for completed vs failed status. Free, no monitor cap.

Mail addresses
hello@lastping.dev

Opengraph URL: https://lastping.dev/monitor/java/

direct link

Domain: lastping.dev


Hey, it has json ld scripts:
  {
    "@context": "https://schema.org",
    "@graph": [
      {
        "@type": "Organization",
        "@id": "https://lastping.dev/#org",
        "name": "LastPing",
        "url": "https://lastping.dev/",
        "logo": "https://lastping.dev/icon-512.png",
        "email": "hello@lastping.dev",
        "sameAs": ["https://github.com/lastping-dev/lastping-app"]
      },
      {
        "@type": "WebSite",
        "@id": "https://lastping.dev/#website",
        "url": "https://lastping.dev/",
        "name": "LastPing",
        "publisher": { "@id": "https://lastping.dev/#org" }
      },
      {
        "@type": "TechArticle",
        "@id": "https://lastping.dev/monitor/java/",
        "url": "https://lastping.dev/monitor/java/",
        "headline": "Monitor Java scheduled jobs: Spring @Scheduled and Spring Batch",
        "description": "How to monitor a Java scheduled job: Spring @Scheduled with try/catch pings LastPing on success and POSTs to /fail on exception; Spring Batch uses a JobExecutionListener to check BatchStatus and ping accordingly.",
        "author": { "@id": "https://lastping.dev/#org" },
        "publisher": { "@id": "https://lastping.dev/#org" },
        "isPartOf": { "@id": "https://lastping.dev/#website" },
        "datePublished": "2026-07-24",
        "dateModified": "2026-07-24"
      },
      {
        "@type": "BreadcrumbList",
        "@id": "https://lastping.dev/monitor/java/#breadcrumb",
        "itemListElement": [
          { "@type": "ListItem", "position": 1, "name": "Home", "item": "https://lastping.dev/" },
          { "@type": "ListItem", "position": 2, "name": "Monitoring guides", "item": "https://lastping.dev/monitor/" },
          { "@type": "ListItem", "position": 3, "name": "Monitor Java scheduled jobs", "item": "https://lastping.dev/monitor/java/" }
        ]
      },
      {
        "@type": "FAQPage",
        "@id": "https://lastping.dev/monitor/java/#faq",
        "mainEntity": [
          {
            "@type": "Question",
            "name": "How do I monitor a Spring @Scheduled job?",
            "acceptedAnswer": {
              "@type": "Answer",
              "text": "Wrap the method body in try/catch: on success, call restTemplate.getForObject on the ping URL; on exception, POST the message to the /fail endpoint and re-throw so Spring can apply its own error handling."
            }
          },
          {
            "@type": "Question",
            "name": "How do I monitor a Spring Batch job?",
            "acceptedAnswer": {
              "@type": "Answer",
              "text": "Implement JobExecutionListener and in afterJob() check jobExecution.getStatus(). If BatchStatus.COMPLETED, GET the ping URL. Otherwise collect the failure exceptions, join them, and POST the text to /fail."
            }
          },
          {
            "@type": "Question",
            "name": "Do I need a dependency like OkHttp or Apache HttpClient?",
            "acceptedAnswer": {
              "@type": "Answer",
              "text": "No. java.net.http.HttpClient (Java 11+) handles both GET and POST without additional dependencies. RestTemplate or WebClient from Spring are convenient wrappers but not required."
            }
          },
          {
            "@type": "Question",
            "name": "What if Spring's scheduler swallows the exception?",
            "acceptedAnswer": {
              "@type": "Answer",
              "text": "Spring's default TaskUtils.LOG_AND_SUPPRESS_ERROR_HANDLER logs the exception but suppresses it so the scheduler keeps running. The /fail ping still fires because it is sent inside the catch block before re-throwing. Configure a custom TaskScheduler error handler if you need further propagation."
            }
          },
          {
            "@type": "Question",
            "name": "How do I monitor a Quartz job in Java?",
            "acceptedAnswer": {
              "@type": "Answer",
              "text": "Implement a JobListener and add ping calls in jobWasExecuted: check jobExecutionException for null to distinguish success from failure. The ping URL is the same; only the hook mechanism differs."
            }
          },
          {
            "@type": "Question",
            "name": "What if the JVM is OOM-killed?",
            "acceptedAnswer": {
              "@type": "Answer",
              "text": "An OOM-killed JVM sends no ping; the missing ping opens an incident after the grace window. This is the core value of absence-detection monitoring for JVM workloads."
            }
          },
          {
            "@type": "Question",
            "name": "Is Java job monitoring free?",
            "acceptedAnswer": {
              "@type": "Answer",
              "text": "Yes. LastPing is free for individuals with no monitor cap. See how it compares to Healthchecks.io and Cronitor."
            }
          }
        ]
      },
      {
        "@type": "HowTo",
        "@id": "https://lastping.dev/monitor/java/#howto",
        "name": "How to monitor a Java Spring scheduled job with LastPing",
        "step": [
          { "@type": "HowToStep", "position": 1, "name": "Create a monitor", "text": "Log in to app.lastping.dev, create a heartbeat monitor, set the schedule to match the @Scheduled cron expression, and set a grace window." },
          { "@type": "HowToStep", "position": 2, "name": "Store the ping URL", "text": "Add lastping.ping-url=https://ping.lastping.dev/ to application.properties and inject it with @Value." },
          { "@type": "HowToStep", "position": 3, "name": "Add try/catch or JobExecutionListener", "text": "For @Scheduled: wrap the body in try/catch, GET on success, POST to /fail on exception, re-throw. For Spring Batch: add a JobExecutionListener bean that checks BatchStatus." },
          { "@type": "HowToStep", "position": 4, "name": "Configure alert channels", "text": "In the LastPing console add email, Slack, Discord, Telegram, ntfy, Pushover, Microsoft Teams, Google Chat or webhook destinations." }
        ]
      }
    ]
  }
  

theme-color#0c0e12
color-schemedark light
og:typewebsite
og:site_nameLastPing
og:imagehttps://lastping.dev/og.png
og:image:width1200
og:image:height630
og:image:altLastPing operations console showing a monitor flatlining to DOWN with alert sent.
twitter:cardsummary_large_image
twitter:imagehttps://lastping.dev/og.png

Links:

Skip to contenthttps://lastping.dev/monitor/java/#main
LastPinghttps://lastping.dev/
Cron and heartbeatsJobs that must run on timehttps://lastping.dev/monitor/cron/
CI/CDPipelines and scheduled workflowshttps://lastping.dev/monitor/github-actions/
HTTP uptimeSites and APIshttps://lastping.dev/monitor/http/
AI agent runsStarted, progress, blocked, failedhttps://lastping.dev/agents/
TracingSpans, tokens, costhttps://lastping.dev/agents/tracing/
MCP serverYour assistant sets it uphttps://lastping.dev/mcp/
Alerts9 destinations, routinghttps://lastping.dev/monitor/alerts/
Status pageshttps://lastping.dev/self-monitored/
TerraformMonitoring as codehttps://lastping.dev/terraform
LastPing runs on LastPingOur own live status page, incidents left visible.https://app.lastping.dev/status/lastping-self
Product overviewhttps://lastping.dev/product
Monitoring as codehttps://lastping.dev/monitoring-as-code
Changeloghttps://lastping.dev/changelog
Pythonhttps://lastping.dev/monitor/python/
Node.jshttps://lastping.dev/monitor/node/
Rubyhttps://lastping.dev/monitor/ruby/
Golanghttps://lastping.dev/monitor/go/
PHPhttps://lastping.dev/monitor/php/
Bashhttps://lastping.dev/monitor/bash/
Javahttps://lastping.dev/monitor/java/
.NEThttps://lastping.dev/monitor/dotnet/
Rusthttps://lastping.dev/monitor/rust/
Denohttps://lastping.dev/monitor/deno/
Cronhttps://lastping.dev/monitor/cron/
Kubernetes CronJobshttps://lastping.dev/monitor/kubernetes/
systemd timershttps://lastping.dev/monitor/systemd/
Backupshttps://lastping.dev/monitor/backups/
AWS Lambdahttps://lastping.dev/monitor/aws-lambda/
Google Cloud Schedulerhttps://lastping.dev/monitor/google-cloud-scheduler/
Azure Functionshttps://lastping.dev/monitor/azure-functions/
Cloudflare Workershttps://lastping.dev/monitor/cloudflare-workers/
Renderhttps://lastping.dev/monitor/render/
Fly.iohttps://lastping.dev/monitor/fly/
Railwayhttps://lastping.dev/monitor/railway/
Herokuhttps://lastping.dev/monitor/heroku/
HTTP and uptimehttps://lastping.dev/monitor/http/
Alert eventshttps://lastping.dev/monitor/alerts/
GitHub Actionshttps://lastping.dev/monitor/github-actions/
GitHub Actions scheduleshttps://lastping.dev/monitor/github-actions-scheduled/
Disabled scheduled workflowshttps://lastping.dev/monitor/github-actions-scheduled-disabled/
GitLab CIhttps://lastping.dev/monitor/gitlab-ci/
Jenkinshttps://lastping.dev/monitor/jenkins/
CircleCIhttps://lastping.dev/monitor/circleci/
Bitbucket Pipelineshttps://lastping.dev/monitor/bitbucket-pipelines/
Drone CIhttps://lastping.dev/monitor/drone-ci/
TeamCityhttps://lastping.dev/monitor/teamcity/
Airflowhttps://lastping.dev/monitor/airflow/
Celeryhttps://lastping.dev/monitor/celery/
Sidekiqhttps://lastping.dev/monitor/sidekiq/
Temporalhttps://lastping.dev/monitor/temporal/
Prefecthttps://lastping.dev/monitor/prefect/
Dagsterhttps://lastping.dev/monitor/dagster/
Hatchethttps://lastping.dev/monitor/hatchet/
Inngesthttps://lastping.dev/monitor/inngest/
Trigger.devhttps://lastping.dev/monitor/trigger-dev/
Claude Codehttps://lastping.dev/monitor/claude-code/
Codexhttps://lastping.dev/monitor/codex/
Cursorhttps://lastping.dev/monitor/cursor/
Claude scheduled taskshttps://lastping.dev/monitor/claude-scheduled-tasks/
Stuck or hanging agentshttps://lastping.dev/monitor/ai-agent-stuck/
n8nhttps://lastping.dev/monitor/n8n/
Zapierhttps://lastping.dev/monitor/zapier/
Makehttps://lastping.dev/monitor/make/
OpenAI Agents SDKhttps://lastping.dev/monitor/openai-agents/
LangChainhttps://lastping.dev/monitor/langchain/
CrewAIhttps://lastping.dev/monitor/crewai/
vs Better Stackhttps://lastping.dev/vs/betterstack/
vs Cronitorhttps://lastping.dev/vs/cronitor/
vs Dead Man's Snitchhttps://lastping.dev/vs/dead-mans-snitch/
vs Healthchecks.iohttps://lastping.dev/vs/healthchecks/
vs Hyperpinghttps://lastping.dev/vs/hyperping/
vs Opsgeniehttps://lastping.dev/vs/opsgenie/
vs Sentry Cronshttps://lastping.dev/vs/sentry-crons/
vs Uptime Kumahttps://lastping.dev/vs/uptime-kuma/
All integrationshttps://lastping.dev/monitor/
Agentshttps://lastping.dev/agents/
Docshttps://app.lastping.dev/docs
Bloghttps://lastping.dev/blog/
Sign inhttps://app.lastping.dev/auth/login
Start freehttps://app.lastping.dev/auth/login?mode=signup
Cron and heartbeatshttps://lastping.dev/monitor/cron/
CI/CDhttps://lastping.dev/monitor/github-actions/
HTTP uptimehttps://lastping.dev/monitor/http/
AI agent runshttps://lastping.dev/agents/
Tracinghttps://lastping.dev/agents/tracing/
MCP serverhttps://lastping.dev/mcp/
Alertshttps://lastping.dev/monitor/alerts/
Status pageshttps://lastping.dev/self-monitored/
Terraformhttps://lastping.dev/terraform
All integrationshttps://lastping.dev/monitor/
Pythonhttps://lastping.dev/monitor/python/
Node.jshttps://lastping.dev/monitor/node/
Rubyhttps://lastping.dev/monitor/ruby/
Golanghttps://lastping.dev/monitor/go/
PHPhttps://lastping.dev/monitor/php/
Bashhttps://lastping.dev/monitor/bash/
Javahttps://lastping.dev/monitor/java/
.NEThttps://lastping.dev/monitor/dotnet/
Rusthttps://lastping.dev/monitor/rust/
Denohttps://lastping.dev/monitor/deno/
Cronhttps://lastping.dev/monitor/cron/
Kubernetes CronJobshttps://lastping.dev/monitor/kubernetes/
systemd timershttps://lastping.dev/monitor/systemd/
Backupshttps://lastping.dev/monitor/backups/
AWS Lambdahttps://lastping.dev/monitor/aws-lambda/
Google Cloud Schedulerhttps://lastping.dev/monitor/google-cloud-scheduler/
Azure Functionshttps://lastping.dev/monitor/azure-functions/
Cloudflare Workershttps://lastping.dev/monitor/cloudflare-workers/
Renderhttps://lastping.dev/monitor/render/
Fly.iohttps://lastping.dev/monitor/fly/
Railwayhttps://lastping.dev/monitor/railway/
Herokuhttps://lastping.dev/monitor/heroku/
HTTP and uptimehttps://lastping.dev/monitor/http/
Alert eventshttps://lastping.dev/monitor/alerts/
GitHub Actionshttps://lastping.dev/monitor/github-actions/
GitHub Actions scheduleshttps://lastping.dev/monitor/github-actions-scheduled/
Disabled scheduled workflowshttps://lastping.dev/monitor/github-actions-scheduled-disabled/
GitLab CIhttps://lastping.dev/monitor/gitlab-ci/
Jenkinshttps://lastping.dev/monitor/jenkins/
CircleCIhttps://lastping.dev/monitor/circleci/
Bitbucket Pipelineshttps://lastping.dev/monitor/bitbucket-pipelines/
Drone CIhttps://lastping.dev/monitor/drone-ci/
TeamCityhttps://lastping.dev/monitor/teamcity/
Airflowhttps://lastping.dev/monitor/airflow/
Celeryhttps://lastping.dev/monitor/celery/
Sidekiqhttps://lastping.dev/monitor/sidekiq/
Temporalhttps://lastping.dev/monitor/temporal/
Prefecthttps://lastping.dev/monitor/prefect/
Dagsterhttps://lastping.dev/monitor/dagster/
Hatchethttps://lastping.dev/monitor/hatchet/
Inngesthttps://lastping.dev/monitor/inngest/
Trigger.devhttps://lastping.dev/monitor/trigger-dev/
Claude Codehttps://lastping.dev/monitor/claude-code/
Codexhttps://lastping.dev/monitor/codex/
Cursorhttps://lastping.dev/monitor/cursor/
Claude scheduled taskshttps://lastping.dev/monitor/claude-scheduled-tasks/
Stuck or hanging agentshttps://lastping.dev/monitor/ai-agent-stuck/
n8nhttps://lastping.dev/monitor/n8n/
Zapierhttps://lastping.dev/monitor/zapier/
Makehttps://lastping.dev/monitor/make/
OpenAI Agents SDKhttps://lastping.dev/monitor/openai-agents/
LangChainhttps://lastping.dev/monitor/langchain/
CrewAIhttps://lastping.dev/monitor/crewai/
vs Better Stackhttps://lastping.dev/vs/betterstack/
vs Cronitorhttps://lastping.dev/vs/cronitor/
vs Dead Man's Snitchhttps://lastping.dev/vs/dead-mans-snitch/
vs Healthchecks.iohttps://lastping.dev/vs/healthchecks/
vs Hyperpinghttps://lastping.dev/vs/hyperping/
vs Opsgeniehttps://lastping.dev/vs/opsgenie/
vs Sentry Cronshttps://lastping.dev/vs/sentry-crons/
vs Uptime Kumahttps://lastping.dev/vs/uptime-kuma/
Product overviewhttps://lastping.dev/product
Live status pagehttps://app.lastping.dev/status/lastping-self
Docshttps://app.lastping.dev/docs
Bloghttps://lastping.dev/blog/
Start freehttps://app.lastping.dev/auth/login?mode=signup
Sign inhttps://app.lastping.dev/auth/login
The snippetshttps://lastping.dev/monitor/java/#setup-heading
What this catcheshttps://lastping.dev/monitor/java/#catches-heading
Questions people askhttps://lastping.dev/monitor/java/#faq-heading
Homehttps://lastping.dev/
Monitoring guideshttps://lastping.dev/monitor/
Your assistant can do this for youhttps://lastping.dev/mcp/
Start monitoring freehttps://app.lastping.dev/auth/login
All monitoring guideshttps://lastping.dev/monitor/
The snippetshttps://lastping.dev/monitor/java/#setup-heading
What this catcheshttps://lastping.dev/monitor/java/#catches-heading
Questions people askhttps://lastping.dev/monitor/java/#faq-heading
the consolehttps://app.lastping.dev/auth/login
cron job guidehttps://lastping.dev/monitor/cron/
LastPing MCP serverhttps://lastping.dev/mcp/
Healthchecks.iohttps://lastping.dev/vs/healthchecks/
Cronitorhttps://lastping.dev/vs/cronitor/
monitors itself the same wayhttps://lastping.dev/self-monitored/
Start monitoring freehttps://app.lastping.dev/auth/login
All monitoring guideshttps://lastping.dev/monitor/
Start freehttps://app.lastping.dev/auth/login?mode=signup
.NEThttps://lastping.dev/monitor/dotnet/
Rusthttps://lastping.dev/monitor/rust/
Denohttps://lastping.dev/monitor/deno/
vs Healthchecks.iohttps://lastping.dev/vs/healthchecks/
LastPinghttps://lastping.dev/
Status pagehttps://app.lastping.dev/status/lastping-self
Overviewhttps://lastping.dev/product
Cronhttps://lastping.dev/monitor/cron/
CI/CDhttps://lastping.dev/monitor/github-actions/
AI agentshttps://lastping.dev/agents/
HTTP uptimehttps://lastping.dev/monitor/http/
MCPhttps://lastping.dev/mcp/
Terraformhttps://lastping.dev/terraform
All guideshttps://lastping.dev/monitor/
Pythonhttps://lastping.dev/monitor/python/
Node.jshttps://lastping.dev/monitor/node/
Golanghttps://lastping.dev/monitor/go/
GitHub Actionshttps://lastping.dev/monitor/github-actions/
Kuberneteshttps://lastping.dev/monitor/kubernetes/
LangChainhttps://lastping.dev/monitor/langchain/
Claude Codehttps://lastping.dev/monitor/claude-code/
vs Better Stackhttps://lastping.dev/vs/betterstack/
vs Cronitorhttps://lastping.dev/vs/cronitor/
vs Dead Man's Snitchhttps://lastping.dev/vs/dead-mans-snitch/
vs Healthchecks.iohttps://lastping.dev/vs/healthchecks/
vs Hyperpinghttps://lastping.dev/vs/hyperping/
vs Opsgeniehttps://lastping.dev/vs/opsgenie/
vs Sentry Cronshttps://lastping.dev/vs/sentry-crons/
vs Uptime Kumahttps://lastping.dev/vs/uptime-kuma/
Abouthttps://lastping.dev/about
Projecthttps://lastping.dev/project
Changeloghttps://lastping.dev/changelog
Bloghttps://lastping.dev/blog/
Docshttps://app.lastping.dev/docs
GitHubhttps://github.com/lastping-dev/lastping-app
Featured on PeerPushhttps://peerpush.com/p/lastping
Smitheryhttps://smithery.ai/servers/lastping/lastping
Glamahttps://glama.ai/mcp/connectors/dev.lastping/lastping
mcp.sohttps://mcp.so/servers/lastping
LobeHubhttps://lobehub.com/mcp/tp322d-lastping-app
free-for.devhttps://free-for.dev/
Privacyhttps://lastping.dev/privacy/
Termshttps://lastping.dev/terms/

Viewport: width=device-width, initial-scale=1

Robots: index,follow,max-image-preview:large


URLs of crawlers that visited me.