{"action":"created","comment":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/pulls/comments/68600230","id":68600230,"diff_hunk":"@@ -107,3 +107,18 @@ public DeployerStepExecutionHandler stepExecutionHandler(JobExplorer jobExplorer\n Spring Cloud Task provides the ability for batch jobs to emit informational messages.  This\n is covered in detail in the section\n <<stream.adoc#stream-integration-batch-events, Spring Batch Events>>.\n+\n+[[batch-failures-and-tasks]]\n+== Batch Job Exit Codes\n+\n+As discussed before Spring Cloud Task applications support the ability to record the exit code of a task execution.\n+However in cases where a user is running a Spring Batch Job within a task, regardless of how the Batch Job\n+Execution completes the result of the task will always be zero when using a CommandLineRunner for example\n+(unless there is an uncaught exception).  Keep in mind\n+that a task is a boot application and the exit code returned from the task is the same as a boot application.  So\n+to have your task return the exit code based on the result of the batch job execution, you can take advantage of the\n+http://docs.spring.io/spring-batch/reference/html/configureJob.html#commandLineJobRunner[CommandLineJobRunner] or\n+write your own code that will check the result of the batch job execution and take advantage of Spring Boot's\n+http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-application-exit[ExitCodeGenerator]\n+interface.","path":"spring-cloud-task-docs/src/main/asciidoc/batch.adoc","position":17,"original_position":17,"commit_id":"175eb37df016affe34a06c63c1aaf1835451841e","original_commit_id":"175eb37df016affe34a06c63c1aaf1835451841e","user":{"login":"mminella","id":630743,"avatar_url":"https://avatars.githubusercontent.com/u/630743?v=3","gravatar_id":"","url":"https://api.github.com/users/mminella","html_url":"https://github.com/mminella","followers_url":"https://api.github.com/users/mminella/followers","following_url":"https://api.github.com/users/mminella/following{/other_user}","gists_url":"https://api.github.com/users/mminella/gists{/gist_id}","starred_url":"https://api.github.com/users/mminella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mminella/subscriptions","organizations_url":"https://api.github.com/users/mminella/orgs","repos_url":"https://api.github.com/users/mminella/repos","events_url":"https://api.github.com/users/mminella/events{/privacy}","received_events_url":"https://api.github.com/users/mminella/received_events","type":"User","site_admin":false},"body":"This isn't correct.  A couple issues:\r\n\r\n* You can't use the `CommandLineJobRunner` because it's not a `CommandLineRunner` (it pre-dates boot) and doesn't integrate with boot.\r\n* The framework isn't going to let an uncaught exception out from the batch job so using the `ExitCodeGenerator` won't be of much help.\r\n\r\nReally, if you want the task to fail if the job fails, right now you need to write your own `CommandLineRunner`.","created_at":"2016-06-27T15:43:20Z","updated_at":"2016-06-27T15:43:20Z","html_url":"https://github.com/spring-cloud/spring-cloud-task/pull/155#discussion_r68600230","pull_request_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/pulls/155","_links":{"self":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-task/pulls/comments/68600230"},"html":{"href":"https://github.com/spring-cloud/spring-cloud-task/pull/155#discussion_r68600230"},"pull_request":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-task/pulls/155"}}},"pull_request":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/pulls/155","id":75167723,"html_url":"https://github.com/spring-cloud/spring-cloud-task/pull/155","diff_url":"https://github.com/spring-cloud/spring-cloud-task/pull/155.diff","patch_url":"https://github.com/spring-cloud/spring-cloud-task/pull/155.patch","issue_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/issues/155","number":155,"state":"open","locked":false,"title":"Document how Job Failures relate to Tasks","user":{"login":"cppwfs","id":695673,"avatar_url":"https://avatars.githubusercontent.com/u/695673?v=3","gravatar_id":"","url":"https://api.github.com/users/cppwfs","html_url":"https://github.com/cppwfs","followers_url":"https://api.github.com/users/cppwfs/followers","following_url":"https://api.github.com/users/cppwfs/following{/other_user}","gists_url":"https://api.github.com/users/cppwfs/gists{/gist_id}","starred_url":"https://api.github.com/users/cppwfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cppwfs/subscriptions","organizations_url":"https://api.github.com/users/cppwfs/orgs","repos_url":"https://api.github.com/users/cppwfs/repos","events_url":"https://api.github.com/users/cppwfs/events{/privacy}","received_events_url":"https://api.github.com/users/cppwfs/received_events","type":"User","site_admin":false},"body":"Resolves #123","created_at":"2016-06-24T20:16:56Z","updated_at":"2016-06-27T15:43:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d50761e61e337a5d5aa5deb1f001139868cece7e","assignee":{"login":"mminella","id":630743,"avatar_url":"https://avatars.githubusercontent.com/u/630743?v=3","gravatar_id":"","url":"https://api.github.com/users/mminella","html_url":"https://github.com/mminella","followers_url":"https://api.github.com/users/mminella/followers","following_url":"https://api.github.com/users/mminella/following{/other_user}","gists_url":"https://api.github.com/users/mminella/gists{/gist_id}","starred_url":"https://api.github.com/users/mminella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mminella/subscriptions","organizations_url":"https://api.github.com/users/mminella/orgs","repos_url":"https://api.github.com/users/mminella/repos","events_url":"https://api.github.com/users/mminella/events{/privacy}","received_events_url":"https://api.github.com/users/mminella/received_events","type":"User","site_admin":false},"assignees":[{"login":"mminella","id":630743,"avatar_url":"https://avatars.githubusercontent.com/u/630743?v=3","gravatar_id":"","url":"https://api.github.com/users/mminella","html_url":"https://github.com/mminella","followers_url":"https://api.github.com/users/mminella/followers","following_url":"https://api.github.com/users/mminella/following{/other_user}","gists_url":"https://api.github.com/users/mminella/gists{/gist_id}","starred_url":"https://api.github.com/users/mminella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mminella/subscriptions","organizations_url":"https://api.github.com/users/mminella/orgs","repos_url":"https://api.github.com/users/mminella/repos","events_url":"https://api.github.com/users/mminella/events{/privacy}","received_events_url":"https://api.github.com/users/mminella/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/pulls/155/commits","review_comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/pulls/155/comments","review_comment_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/issues/155/comments","statuses_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/statuses/175eb37df016affe34a06c63c1aaf1835451841e","head":{"label":"cppwfs:SCT-123","ref":"SCT-123","sha":"175eb37df016affe34a06c63c1aaf1835451841e","user":{"login":"cppwfs","id":695673,"avatar_url":"https://avatars.githubusercontent.com/u/695673?v=3","gravatar_id":"","url":"https://api.github.com/users/cppwfs","html_url":"https://github.com/cppwfs","followers_url":"https://api.github.com/users/cppwfs/followers","following_url":"https://api.github.com/users/cppwfs/following{/other_user}","gists_url":"https://api.github.com/users/cppwfs/gists{/gist_id}","starred_url":"https://api.github.com/users/cppwfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cppwfs/subscriptions","organizations_url":"https://api.github.com/users/cppwfs/orgs","repos_url":"https://api.github.com/users/cppwfs/repos","events_url":"https://api.github.com/users/cppwfs/events{/privacy}","received_events_url":"https://api.github.com/users/cppwfs/received_events","type":"User","site_admin":false},"repo":{"id":61756230,"name":"spring-cloud-task","full_name":"cppwfs/spring-cloud-task","owner":{"login":"cppwfs","id":695673,"avatar_url":"https://avatars.githubusercontent.com/u/695673?v=3","gravatar_id":"","url":"https://api.github.com/users/cppwfs","html_url":"https://github.com/cppwfs","followers_url":"https://api.github.com/users/cppwfs/followers","following_url":"https://api.github.com/users/cppwfs/following{/other_user}","gists_url":"https://api.github.com/users/cppwfs/gists{/gist_id}","starred_url":"https://api.github.com/users/cppwfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cppwfs/subscriptions","organizations_url":"https://api.github.com/users/cppwfs/orgs","repos_url":"https://api.github.com/users/cppwfs/repos","events_url":"https://api.github.com/users/cppwfs/events{/privacy}","received_events_url":"https://api.github.com/users/cppwfs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cppwfs/spring-cloud-task","description":"Short lived microservices","fork":true,"url":"https://api.github.com/repos/cppwfs/spring-cloud-task","forks_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/forks","keys_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/teams","hooks_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/hooks","issue_events_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/issues/events{/number}","events_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/events","assignees_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/assignees{/user}","branches_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/branches{/branch}","tags_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/tags","blobs_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/git/refs{/sha}","trees_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/statuses/{sha}","languages_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/languages","stargazers_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/stargazers","contributors_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/contributors","subscribers_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/subscribers","subscription_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/subscription","commits_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/commits{/sha}","git_commits_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/git/commits{/sha}","comments_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/comments{/number}","issue_comment_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/issues/comments{/number}","contents_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/contents/{+path}","compare_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/merges","archive_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/downloads","issues_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/issues{/number}","pulls_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/pulls{/number}","milestones_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/milestones{/number}","notifications_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/labels{/name}","releases_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/releases{/id}","deployments_url":"https://api.github.com/repos/cppwfs/spring-cloud-task/deployments","created_at":"2016-06-22T22:41:55Z","updated_at":"2016-06-22T22:41:56Z","pushed_at":"2016-06-24T20:19:46Z","git_url":"git://github.com/cppwfs/spring-cloud-task.git","ssh_url":"git@github.com:cppwfs/spring-cloud-task.git","clone_url":"https://github.com/cppwfs/spring-cloud-task.git","svn_url":"https://github.com/cppwfs/spring-cloud-task","homepage":"http://cloud.spring.io/spring-cloud-task/","size":1342,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"spring-cloud:master","ref":"master","sha":"319db45c4ecebf398a77174cdd928fd949c4a54f","user":{"login":"spring-cloud","id":7815877,"avatar_url":"https://avatars.githubusercontent.com/u/7815877?v=3","gravatar_id":"","url":"https://api.github.com/users/spring-cloud","html_url":"https://github.com/spring-cloud","followers_url":"https://api.github.com/users/spring-cloud/followers","following_url":"https://api.github.com/users/spring-cloud/following{/other_user}","gists_url":"https://api.github.com/users/spring-cloud/gists{/gist_id}","starred_url":"https://api.github.com/users/spring-cloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spring-cloud/subscriptions","organizations_url":"https://api.github.com/users/spring-cloud/orgs","repos_url":"https://api.github.com/users/spring-cloud/repos","events_url":"https://api.github.com/users/spring-cloud/events{/privacy}","received_events_url":"https://api.github.com/users/spring-cloud/received_events","type":"Organization","site_admin":false},"repo":{"id":41825227,"name":"spring-cloud-task","full_name":"spring-cloud/spring-cloud-task","owner":{"login":"spring-cloud","id":7815877,"avatar_url":"https://avatars.githubusercontent.com/u/7815877?v=3","gravatar_id":"","url":"https://api.github.com/users/spring-cloud","html_url":"https://github.com/spring-cloud","followers_url":"https://api.github.com/users/spring-cloud/followers","following_url":"https://api.github.com/users/spring-cloud/following{/other_user}","gists_url":"https://api.github.com/users/spring-cloud/gists{/gist_id}","starred_url":"https://api.github.com/users/spring-cloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spring-cloud/subscriptions","organizations_url":"https://api.github.com/users/spring-cloud/orgs","repos_url":"https://api.github.com/users/spring-cloud/repos","events_url":"https://api.github.com/users/spring-cloud/events{/privacy}","received_events_url":"https://api.github.com/users/spring-cloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spring-cloud/spring-cloud-task","description":"Short lived microservices","fork":false,"url":"https://api.github.com/repos/spring-cloud/spring-cloud-task","forks_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/forks","keys_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/teams","hooks_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/hooks","issue_events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/issues/events{/number}","events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/events","assignees_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/assignees{/user}","branches_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/branches{/branch}","tags_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/tags","blobs_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/git/refs{/sha}","trees_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/statuses/{sha}","languages_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/languages","stargazers_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/stargazers","contributors_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/contributors","subscribers_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/subscribers","subscription_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/subscription","commits_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/commits{/sha}","git_commits_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/git/commits{/sha}","comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/comments{/number}","issue_comment_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/issues/comments{/number}","contents_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/contents/{+path}","compare_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/merges","archive_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/downloads","issues_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/issues{/number}","pulls_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/pulls{/number}","milestones_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/milestones{/number}","notifications_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/labels{/name}","releases_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/releases{/id}","deployments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-task/deployments","created_at":"2015-09-02T20:12:00Z","updated_at":"2016-06-17T22:02:02Z","pushed_at":"2016-06-27T14:34:10Z","git_url":"git://github.com/spring-cloud/spring-cloud-task.git","ssh_url":"git@github.com:spring-cloud/spring-cloud-task.git","clone_url":"https://github.com/spring-cloud/spring-cloud-task.git","svn_url":"https://github.com/spring-cloud/spring-cloud-task","homepage":"http://cloud.spring.io/spring-cloud-task/","size":1568,"stargazers_count":19,"watchers_count":19,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":20,"mirror_url":null,"open_issues_count":10,"forks":20,"open_issues":10,"watchers":19,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-task/pulls/155"},"html":{"href":"https://github.com/spring-cloud/spring-cloud-task/pull/155"},"issue":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-task/issues/155"},"comments":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-task/issues/155/comments"},"review_comments":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-task/pulls/155/comments"},"review_comment":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-task/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-task/pulls/155/commits"},"statuses":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-task/statuses/175eb37df016affe34a06c63c1aaf1835451841e"}}}}
{"actor":{"display_login":"mminella"}}