{"id":19049761,"url":"https://github.com/asalan316/spring-cloud-task-service","last_synced_at":"2025-11-12T07:03:29.120Z","repository":{"id":128929956,"uuid":"245164915","full_name":"asalan316/spring-cloud-task-service","owner":"asalan316","description":"Short Live Microservice using Spring Boot Task","archived":false,"fork":false,"pushed_at":"2020-03-19T11:22:08.000Z","size":55,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-22T00:23:33.988Z","etag":null,"topics":["cf-tasks","cloud-foundry","microservice","scheduled-tasks","short-lived-microservices","spring-cloud-task"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/asalan316.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-05T13:03:26.000Z","updated_at":"2022-02-02T05:07:06.000Z","dependencies_parsed_at":"2023-05-31T21:30:42.667Z","dependency_job_id":null,"html_url":"https://github.com/asalan316/spring-cloud-task-service","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/asalan316/spring-cloud-task-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asalan316%2Fspring-cloud-task-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asalan316%2Fspring-cloud-task-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asalan316%2Fspring-cloud-task-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asalan316%2Fspring-cloud-task-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asalan316","download_url":"https://codeload.github.com/asalan316/spring-cloud-task-service/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asalan316%2Fspring-cloud-task-service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":283990377,"owners_count":26928670,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-12T02:00:06.336Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cf-tasks","cloud-foundry","microservice","scheduled-tasks","short-lived-microservices","spring-cloud-task"],"created_at":"2024-11-08T23:11:53.749Z","updated_at":"2025-11-12T07:03:29.089Z","avatar_url":"https://github.com/asalan316.png","language":"Java","readme":"# Short Lived Microservice using spring-cloud-starter-task\n\nTasks in spring boot are generally used for short lived microservices.\nThis example microservice sends http GET request and log the response using Spring Cloud Task.\n\nUse case\n\n - run microservice as task (short live microservice) and stop automatically once the HTTP request finished.\n - send HTTP GET inside commandLineRunner\n - configure Http base url in application.yml \n - deploy service on Cloud Foundry\n\n# Deploy service on Cloud Foundry\n\n 1. compile app and create jar \n \n\t\t mvn clean install\n\t\t \n 2. Push an app using --health-check-type none and no-route parameters\n\n    `cf push -f manifest-dev.yml --health-check-type none --no-route --no-start`\n    \n    Notice: In general, CF tasks has no routes as they are meant to perform background tasks.\n\n 3. Run this app as cf task\n\n\t   `cf run-task task-service \".java-buildpack/open_jdk_jre/bin/java org.springframework.boot.loader.JarLauncher\" --name \"task-service\"`\n\n\t `syntax:\n    cf.exe run-task APP_NAME COMMAND [-k DISK] [-m MEMORY] [--name TASK_NAME]`\n    \n# Trigger task automatically\n 1. CF tasks can be scheduled using jobs. There is a service broker available in PCF marketplace.https://network.pivotal.io/products/p\n -scheduler-for-pcf\n \n ` cf create-job task-service task-service-job \".java-buildpack/open_jdk_jre/bin/java org.springframework.boot.loader.JarLauncher\" `  \n\n2 run job\n\n`cf run-job task-service`\n\ncreate schedule for the job. This enables job to be execute after defined time interval. The scheduler accepts MIN HOUR DAY-OF-MONTH\n MONTH DAY-OF-WEEK format. For instance, the following will execute task-service-job on 5th of every month at 10:00am\n\n `cf schedule-job task-service-job \"0 10 5 * ? *\" `\n \n \n#Troubleshooting\n\n- Pivotal Scheduler CLI plugin is required to interact with cf jobs\nhttps://network.pivotal.io/products/p-scheduler-for-pcf\n\n- The example spring boot app does not have \"spring-boot-starter-web\" dependency in pom.xml. Including the mentioned dependency will \nkeep the app always in \"Running\" state. The goal is to create short-lived microservice as described in use case section. \n```\n\u003cdependency\u003e\n     \u003cgroupId\u003eorg.springframework.boot\u003c/groupId\u003e\n     \u003cartifactId\u003espring-boot-starter-web\u003c/artifactId\u003e\n \u003c/dependency\u003e  \n```\n# References\n\nSpring Cloud Task:\n[https://spring.io/projects/spring-cloud-task](https://spring.io/projects/spring-cloud-task)\n\ncf tasks:\n[https://docs.cloudfoundry.org/devguide/using-tasks.html](https://docs.cloudfoundry.org/devguide/using-tasks.html)\n\ncf jobs:\n[https://docs.pivotal.io/scheduler/1-2/using-jobs.html](https://docs.pivotal.io/scheduler/1-2/using-jobs.html)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasalan316%2Fspring-cloud-task-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasalan316%2Fspring-cloud-task-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasalan316%2Fspring-cloud-task-service/lists"}