This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit eadf86940085bd3bf3f9b604f8e6660520833168 Author: Claus Ibsen <[email protected]> AuthorDate: Fri Nov 27 19:52:02 2026 +0100 CAMEL-23832: camel-spring-batch - improve the component and option descriptions This commit rewrites the component description, 2 component options, 4 endpoint options and 1 header of spring-batch. The old component text said that messages are sent to Spring Batch, while the component launches a job and passes the message headers as job parameters. The new texts say how the job, the JobLauncher and the JobRegistry are resolved, and that the jobName path is not used when jobFromHeader is true. Documentation only, no behavior change. The component JSON, the catalog copy, the doc page header and the DSL are regenerated. camel-spring-batch is marked as done in tasks/component-descriptions.md. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Claus Ibsen <[email protected]> --- .../camel/catalog/components/spring-batch.json | 16 +++--- .../camel/catalog/docs/spring-batch-component.adoc | 4 +- .../camel/component/spring/batch/spring-batch.json | 16 +++--- .../src/main/docs/spring-batch-component.adoc | 4 +- .../spring/batch/SpringBatchComponent.java | 16 +++--- .../spring/batch/SpringBatchConstants.java | 4 +- .../spring/batch/SpringBatchEndpoint.java | 29 +++++------ .../component/ComponentsBuilderFactory.java | 2 +- .../dsl/SpringBatchComponentBuilderFactory.java | 13 +++-- .../builder/endpoint/EndpointHeaderBuilders.java | 2 +- .../builder/endpoint/StaticEndpointBuilders.java | 14 ++++-- .../dsl/SpringBatchEndpointBuilderFactory.java | 57 ++++++++++++++++------ tasks/component-descriptions.md | 2 +- 13 files changed, 104 insertions(+), 75 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/spring-batch.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/spring-batch.json index 7aa7301489a1..9eafb636f42e 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/spring-batch.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/spring-batch.json @@ -3,7 +3,7 @@ "kind": "component", "name": "spring-batch", "title": "Spring Batch", - "description": "Send messages to Spring Batch for further processing.", + "description": "Launch Spring Batch jobs, with the message headers as the job parameters.", "deprecated": false, "firstVersion": "2.10.0", "label": "workflow", @@ -24,23 +24,23 @@ "remote": false }, "componentProperties": { - "jobLauncher": { "index": 0, "kind": "property", "displayName": "Job Launcher", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.springframework.batch.core.launch.JobLauncher", "deprecated": false, "autowired": true, "secret": false, "description": "Explicitly specifies a JobLauncher to be used." }, - "jobRegistry": { "index": 1, "kind": "property", "displayName": "Job Registry", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.springframework.batch.core.configuration.JobRegistry", "deprecated": false, "autowired": true, "secret": false, "description": "Explicitly specifies a JobRegistry to be used." }, + "jobLauncher": { "index": 0, "kind": "property", "displayName": "Job Launcher", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.springframework.batch.core.launch.JobLauncher", "deprecated": false, "autowired": true, "secret": false, "description": "The JobLauncher that runs the jobs of all endpoints, unless an endpoint sets its own. When not set, the component uses the single JobLauncher of the registry, or else the bean named jobLauncher." }, + "jobRegistry": { "index": 1, "kind": "property", "displayName": "Job Registry", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.springframework.batch.core.configuration.JobRegistry", "deprecated": false, "autowired": true, "secret": false, "description": "The JobRegistry in which the endpoints look up the job by its name, unless an endpoint sets its own. A job that is not in it, or every job when no JobRegistry is set, is looked up in the Camel [...] "lazyStartProducer": { "index": 2, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...] "autowiredEnabled": { "index": 3, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...] }, "headers": { - "CamelSpringBatchJobName": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the Batch Job to use. Only used when the endpoint has jobFromHeader=true.", "constantName": "org.apache.camel.component.spring.batch.SpringBatchConstants#JOB_NAME" } + "CamelSpringBatchJobName": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the Spring Batch job to launch for this message, looked up like the jobName path. Only read when the endpoint has jobFromHeader=true. Like every other header, it is also passed to the job as a job parameter.", "constantName": "org.apache.camel.compo [...] }, "bodyTypes": { "producerIn": { "carriers": [ "any" ], "description": "The body is not read: the job parameters are the message headers (Date, Long and Double values as such, other values as text; headers with a null value are skipped)" }, "producerOut": { "carriers": [ "pojo" ], "javaType": "org.springframework.batch.core.job.JobExecution", "description": "The JobExecution of the launched job, with its status and exit status; the headers stay as they were" } }, "properties": { - "jobName": { "index": 0, "kind": "path", "displayName": "Job Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the Spring Batch job located in the registry." }, - "jobFromHeader": { "index": 1, "kind": "parameter", "displayName": "Job From Header", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Explicitly defines if the jobName should be taken from the headers instead of the URI." }, - "jobLauncher": { "index": 2, "kind": "parameter", "displayName": "Job Launcher", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.springframework.batch.core.launch.JobLauncher", "deprecated": false, "autowired": false, "secret": false, "description": "Explicitly specifies a JobLauncher to be used." }, - "jobRegistry": { "index": 3, "kind": "parameter", "displayName": "Job Registry", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.springframework.batch.core.configuration.JobRegistry", "deprecated": false, "autowired": false, "secret": false, "description": "Explicitly specifies a JobRegistry to be used." }, + "jobName": { "index": 0, "kind": "path", "displayName": "Job Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the Spring Batch job to launch. When the endpoint starts, the job is looked up in the jobRegistry, when one is set, and else in the Camel registry as a Job bean; the endpoint fails to start when the job is not found. Not used when j [...] + "jobFromHeader": { "index": 1, "kind": "parameter", "displayName": "Job From Header", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer takes the name of the job to launch from the CamelSpringBatchJobName header of each message instead of the jobName path, and looks the job up for every message. The exchange fails when the [...] + "jobLauncher": { "index": 2, "kind": "parameter", "displayName": "Job Launcher", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.springframework.batch.core.launch.JobLauncher", "deprecated": false, "autowired": false, "secret": false, "description": "The JobLauncher that runs the job, instead of the jobLauncher of the component. When neither is set, the endpoint uses the single JobLauncher of the registry and fails to start when there is none o [...] + "jobRegistry": { "index": 3, "kind": "parameter", "displayName": "Job Registry", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.springframework.batch.core.configuration.JobRegistry", "deprecated": false, "autowired": false, "secret": false, "description": "The JobRegistry in which the job is looked up by its name, instead of the jobRegistry of the component. A job that is not in it is looked up in the Camel registry as a Job bean." }, "lazyStartProducer": { "index": 4, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produc [...] } } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/spring-batch-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/spring-batch-component.adoc index 8a4e507ac76e..c559a5de72e2 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/spring-batch-component.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/spring-batch-component.adoc @@ -2,7 +2,7 @@ :doctitle: Spring Batch :shortname: spring-batch :artifactid: camel-spring-batch -:description: Send messages to Spring Batch for further processing. +:description: Launch Spring Batch jobs, with the message headers as the job parameters. :since: 2.10 :supportlevel: Stable :tabs-sync-option: @@ -301,5 +301,3 @@ JMS queue. </batch:listeners> </batch:job> ---- - - diff --git a/components/camel-spring-parent/camel-spring-batch/src/generated/resources/META-INF/org/apache/camel/component/spring/batch/spring-batch.json b/components/camel-spring-parent/camel-spring-batch/src/generated/resources/META-INF/org/apache/camel/component/spring/batch/spring-batch.json index 7aa7301489a1..9eafb636f42e 100644 --- a/components/camel-spring-parent/camel-spring-batch/src/generated/resources/META-INF/org/apache/camel/component/spring/batch/spring-batch.json +++ b/components/camel-spring-parent/camel-spring-batch/src/generated/resources/META-INF/org/apache/camel/component/spring/batch/spring-batch.json @@ -3,7 +3,7 @@ "kind": "component", "name": "spring-batch", "title": "Spring Batch", - "description": "Send messages to Spring Batch for further processing.", + "description": "Launch Spring Batch jobs, with the message headers as the job parameters.", "deprecated": false, "firstVersion": "2.10.0", "label": "workflow", @@ -24,23 +24,23 @@ "remote": false }, "componentProperties": { - "jobLauncher": { "index": 0, "kind": "property", "displayName": "Job Launcher", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.springframework.batch.core.launch.JobLauncher", "deprecated": false, "autowired": true, "secret": false, "description": "Explicitly specifies a JobLauncher to be used." }, - "jobRegistry": { "index": 1, "kind": "property", "displayName": "Job Registry", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.springframework.batch.core.configuration.JobRegistry", "deprecated": false, "autowired": true, "secret": false, "description": "Explicitly specifies a JobRegistry to be used." }, + "jobLauncher": { "index": 0, "kind": "property", "displayName": "Job Launcher", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.springframework.batch.core.launch.JobLauncher", "deprecated": false, "autowired": true, "secret": false, "description": "The JobLauncher that runs the jobs of all endpoints, unless an endpoint sets its own. When not set, the component uses the single JobLauncher of the registry, or else the bean named jobLauncher." }, + "jobRegistry": { "index": 1, "kind": "property", "displayName": "Job Registry", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.springframework.batch.core.configuration.JobRegistry", "deprecated": false, "autowired": true, "secret": false, "description": "The JobRegistry in which the endpoints look up the job by its name, unless an endpoint sets its own. A job that is not in it, or every job when no JobRegistry is set, is looked up in the Camel [...] "lazyStartProducer": { "index": 2, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...] "autowiredEnabled": { "index": 3, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...] }, "headers": { - "CamelSpringBatchJobName": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the Batch Job to use. Only used when the endpoint has jobFromHeader=true.", "constantName": "org.apache.camel.component.spring.batch.SpringBatchConstants#JOB_NAME" } + "CamelSpringBatchJobName": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the Spring Batch job to launch for this message, looked up like the jobName path. Only read when the endpoint has jobFromHeader=true. Like every other header, it is also passed to the job as a job parameter.", "constantName": "org.apache.camel.compo [...] }, "bodyTypes": { "producerIn": { "carriers": [ "any" ], "description": "The body is not read: the job parameters are the message headers (Date, Long and Double values as such, other values as text; headers with a null value are skipped)" }, "producerOut": { "carriers": [ "pojo" ], "javaType": "org.springframework.batch.core.job.JobExecution", "description": "The JobExecution of the launched job, with its status and exit status; the headers stay as they were" } }, "properties": { - "jobName": { "index": 0, "kind": "path", "displayName": "Job Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the Spring Batch job located in the registry." }, - "jobFromHeader": { "index": 1, "kind": "parameter", "displayName": "Job From Header", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Explicitly defines if the jobName should be taken from the headers instead of the URI." }, - "jobLauncher": { "index": 2, "kind": "parameter", "displayName": "Job Launcher", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.springframework.batch.core.launch.JobLauncher", "deprecated": false, "autowired": false, "secret": false, "description": "Explicitly specifies a JobLauncher to be used." }, - "jobRegistry": { "index": 3, "kind": "parameter", "displayName": "Job Registry", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.springframework.batch.core.configuration.JobRegistry", "deprecated": false, "autowired": false, "secret": false, "description": "Explicitly specifies a JobRegistry to be used." }, + "jobName": { "index": 0, "kind": "path", "displayName": "Job Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the Spring Batch job to launch. When the endpoint starts, the job is looked up in the jobRegistry, when one is set, and else in the Camel registry as a Job bean; the endpoint fails to start when the job is not found. Not used when j [...] + "jobFromHeader": { "index": 1, "kind": "parameter", "displayName": "Job From Header", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer takes the name of the job to launch from the CamelSpringBatchJobName header of each message instead of the jobName path, and looks the job up for every message. The exchange fails when the [...] + "jobLauncher": { "index": 2, "kind": "parameter", "displayName": "Job Launcher", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.springframework.batch.core.launch.JobLauncher", "deprecated": false, "autowired": false, "secret": false, "description": "The JobLauncher that runs the job, instead of the jobLauncher of the component. When neither is set, the endpoint uses the single JobLauncher of the registry and fails to start when there is none o [...] + "jobRegistry": { "index": 3, "kind": "parameter", "displayName": "Job Registry", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.springframework.batch.core.configuration.JobRegistry", "deprecated": false, "autowired": false, "secret": false, "description": "The JobRegistry in which the job is looked up by its name, instead of the jobRegistry of the component. A job that is not in it is looked up in the Camel registry as a Job bean." }, "lazyStartProducer": { "index": 4, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produc [...] } } diff --git a/components/camel-spring-parent/camel-spring-batch/src/main/docs/spring-batch-component.adoc b/components/camel-spring-parent/camel-spring-batch/src/main/docs/spring-batch-component.adoc index 8a4e507ac76e..c559a5de72e2 100644 --- a/components/camel-spring-parent/camel-spring-batch/src/main/docs/spring-batch-component.adoc +++ b/components/camel-spring-parent/camel-spring-batch/src/main/docs/spring-batch-component.adoc @@ -2,7 +2,7 @@ :doctitle: Spring Batch :shortname: spring-batch :artifactid: camel-spring-batch -:description: Send messages to Spring Batch for further processing. +:description: Launch Spring Batch jobs, with the message headers as the job parameters. :since: 2.10 :supportlevel: Stable :tabs-sync-option: @@ -301,5 +301,3 @@ JMS queue. </batch:listeners> </batch:job> ---- - - diff --git a/components/camel-spring-parent/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/SpringBatchComponent.java b/components/camel-spring-parent/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/SpringBatchComponent.java index edda605605cd..f51e20dc26c3 100644 --- a/components/camel-spring-parent/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/SpringBatchComponent.java +++ b/components/camel-spring-parent/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/SpringBatchComponent.java @@ -28,9 +28,15 @@ import org.springframework.batch.core.launch.JobLauncher; @Component("spring-batch") public class SpringBatchComponent extends DefaultComponent { - @Metadata(autowired = true) + @Metadata(autowired = true, + description = "The JobLauncher that runs the jobs of all endpoints, unless an endpoint sets its own. When not" + + " set, the component uses the single JobLauncher of the registry, or else the bean named" + + " jobLauncher.") private JobLauncher jobLauncher; - @Metadata(autowired = true) + @Metadata(autowired = true, + description = "The JobRegistry in which the endpoints look up the job by its name, unless an endpoint sets its" + + " own. A job that is not in it, or every job when no JobRegistry is set, is looked up in the" + + " Camel registry as a Job bean.") private JobRegistry jobRegistry; public SpringBatchComponent() { @@ -57,9 +63,6 @@ public class SpringBatchComponent extends DefaultComponent { return jobLauncher; } - /** - * Explicitly specifies a JobLauncher to be used. - */ public void setJobLauncher(JobLauncher jobLauncher) { this.jobLauncher = jobLauncher; } @@ -68,9 +71,6 @@ public class SpringBatchComponent extends DefaultComponent { return jobRegistry; } - /** - * Explicitly specifies a JobRegistry to be used. - */ public void setJobRegistry(JobRegistry jobRegistry) { this.jobRegistry = jobRegistry; } diff --git a/components/camel-spring-parent/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/SpringBatchConstants.java b/components/camel-spring-parent/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/SpringBatchConstants.java index 3a3d23d34569..e15f3010de09 100644 --- a/components/camel-spring-parent/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/SpringBatchConstants.java +++ b/components/camel-spring-parent/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/SpringBatchConstants.java @@ -25,7 +25,9 @@ public final class SpringBatchConstants { public static final String DEFAULT_JOB_LAUNCHER_REF_NAME = "jobLauncher"; - @Metadata(description = "The name of the Batch Job to use. Only used when the endpoint has jobFromHeader=true.", + @Metadata(description = "The name of the Spring Batch job to launch for this message, looked up like the jobName path." + + " Only read when the endpoint has jobFromHeader=true. Like every other header, it is also" + + " passed to the job as a job parameter.", javaType = "String") public static final String JOB_NAME = "CamelSpringBatchJobName"; diff --git a/components/camel-spring-parent/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/SpringBatchEndpoint.java b/components/camel-spring-parent/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/SpringBatchEndpoint.java index 8aa5278e4925..c4f9e606b2b6 100644 --- a/components/camel-spring-parent/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/SpringBatchEndpoint.java +++ b/components/camel-spring-parent/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/SpringBatchEndpoint.java @@ -35,7 +35,7 @@ import org.springframework.batch.core.job.Job; import org.springframework.batch.core.launch.JobLauncher; /** - * Send messages to Spring Batch for further processing. + * Launch Spring Batch jobs, with the message headers as the job parameters. */ @UriEndpoint(firstVersion = "2.10.0", scheme = "spring-batch", title = "Spring Batch", syntax = "spring-batch:jobName", remote = false, producerOnly = true, headersClass = SpringBatchConstants.class, category = { Category.WORKFLOW }) @@ -47,14 +47,21 @@ import org.springframework.batch.core.launch.JobLauncher; + " headers stay as they were")) public class SpringBatchEndpoint extends DefaultEndpoint { - @UriPath + @UriPath(description = "The name of the Spring Batch job to launch. When the endpoint starts, the job is looked up in the" + + " jobRegistry, when one is set, and else in the Camel registry as a Job bean; the endpoint fails" + + " to start when the job is not found. Not used when jobFromHeader is true.") @Metadata(required = true) private String jobName; - @UriParam + @UriParam(description = "Whether the producer takes the name of the job to launch from the CamelSpringBatchJobName header" + + " of each message instead of the jobName path, and looks the job up for every message. The" + + " exchange fails when the header is missing. When false, that header is ignored.") private boolean jobFromHeader; - @UriParam + @UriParam(description = "The JobLauncher that runs the job, instead of the jobLauncher of the component. When neither is" + + " set, the endpoint uses the single JobLauncher of the registry and fails to start when there" + + " is none or more than one.") private JobLauncher jobLauncher; - @UriParam + @UriParam(description = "The JobRegistry in which the job is looked up by its name, instead of the jobRegistry of the" + + " component. A job that is not in it is looked up in the Camel registry as a Job bean.") private JobRegistry jobRegistry; private Job job; @@ -104,9 +111,6 @@ public class SpringBatchEndpoint extends DefaultEndpoint { return jobName; } - /** - * The name of the Spring Batch job located in the registry. - */ public void setJobName(String jobName) { this.jobName = jobName; } @@ -115,16 +119,10 @@ public class SpringBatchEndpoint extends DefaultEndpoint { return jobLauncher; } - /** - * Explicitly specifies a JobLauncher to be used. - */ public void setJobLauncher(JobLauncher jobLauncher) { this.jobLauncher = jobLauncher; } - /** - * Explicitly defines if the jobName should be taken from the headers instead of the URI. - */ public void setJobFromHeader(boolean jobFromHeader) { this.jobFromHeader = jobFromHeader; } @@ -137,9 +135,6 @@ public class SpringBatchEndpoint extends DefaultEndpoint { return jobRegistry; } - /** - * Explicitly specifies a JobRegistry to be used. - */ public void setJobRegistry(JobRegistry jobRegistry) { this.jobRegistry = jobRegistry; } diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java index 4ed76ced4e36..f67c498c522d 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java @@ -4969,7 +4969,7 @@ public interface ComponentsBuilderFactory { } /** * Spring Batch (camel-spring-batch) - * Send messages to Spring Batch for further processing. + * Launch Spring Batch jobs, with the message headers as the job parameters. * * Category: workflow * Since: 2.10 diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SpringBatchComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SpringBatchComponentBuilderFactory.java index f5af014eb10a..671d4327a669 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SpringBatchComponentBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SpringBatchComponentBuilderFactory.java @@ -24,7 +24,7 @@ import org.apache.camel.builder.component.ComponentBuilder; import org.apache.camel.component.spring.batch.SpringBatchComponent; /** - * Send messages to Spring Batch for further processing. + * Launch Spring Batch jobs, with the message headers as the job parameters. * * Generated by camel build tools - do NOT edit this file! */ @@ -33,7 +33,7 @@ public interface SpringBatchComponentBuilderFactory { /** * Spring Batch (camel-spring-batch) - * Send messages to Spring Batch for further processing. + * Launch Spring Batch jobs, with the message headers as the job parameters. * * Category: workflow * Since: 2.10 @@ -51,7 +51,9 @@ public interface SpringBatchComponentBuilderFactory { interface SpringBatchComponentBuilder extends ComponentBuilder<SpringBatchComponent> { /** - * Explicitly specifies a JobLauncher to be used. + * The JobLauncher that runs the jobs of all endpoints, unless an + * endpoint sets its own. When not set, the component uses the single + * JobLauncher of the registry, or else the bean named jobLauncher. * * The option is a: * <code>org.springframework.batch.core.launch.JobLauncher</code> type. @@ -67,7 +69,10 @@ public interface SpringBatchComponentBuilderFactory { } /** - * Explicitly specifies a JobRegistry to be used. + * The JobRegistry in which the endpoints look up the job by its name, + * unless an endpoint sets its own. A job that is not in it, or every + * job when no JobRegistry is set, is looked up in the Camel registry as + * a Job bean. * * The option is a: * <code>org.springframework.batch.core.configuration.JobRegistry</code> type. diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java index 8c68d9940b64..d2d70b515978 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java @@ -3963,7 +3963,7 @@ public class EndpointHeaderBuilders { } /** * Spring Batch (camel-spring-batch) - * Send messages to Spring Batch for further processing. + * Launch Spring Batch jobs, with the message headers as the job parameters. * * Category: workflow * Since: 2.10 diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java index 23fe78da4ece..0eba83c17404 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java @@ -17046,7 +17046,7 @@ public class StaticEndpointBuilders { } /** * Spring Batch (camel-spring-batch) - * Send messages to Spring Batch for further processing. + * Launch Spring Batch jobs, with the message headers as the job parameters. * * Category: workflow * Since: 2.10 @@ -17055,7 +17055,10 @@ public class StaticEndpointBuilders { * Syntax: <code>spring-batch:jobName</code> * * Path parameter: jobName (required) - * The name of the Spring Batch job located in the registry. + * The name of the Spring Batch job to launch. When the endpoint starts, the + * job is looked up in the jobRegistry, when one is set, and else in the + * Camel registry as a Job bean; the endpoint fails to start when the job is + * not found. Not used when jobFromHeader is true. * * @param path jobName * @return the dsl builder @@ -17065,7 +17068,7 @@ public class StaticEndpointBuilders { } /** * Spring Batch (camel-spring-batch) - * Send messages to Spring Batch for further processing. + * Launch Spring Batch jobs, with the message headers as the job parameters. * * Category: workflow * Since: 2.10 @@ -17074,7 +17077,10 @@ public class StaticEndpointBuilders { * Syntax: <code>spring-batch:jobName</code> * * Path parameter: jobName (required) - * The name of the Spring Batch job located in the registry. + * The name of the Spring Batch job to launch. When the endpoint starts, the + * job is looked up in the jobRegistry, when one is set, and else in the + * Camel registry as a Job bean; the endpoint fails to start when the job is + * not found. Not used when jobFromHeader is true. * * @param componentName to use a custom component name for the endpoint * instead of the default name diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SpringBatchEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SpringBatchEndpointBuilderFactory.java index 12a29a4885ca..36194e208cfe 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SpringBatchEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SpringBatchEndpointBuilderFactory.java @@ -27,7 +27,7 @@ import org.apache.camel.builder.EndpointProducerBuilder; import org.apache.camel.builder.endpoint.AbstractEndpointBuilder; /** - * Send messages to Spring Batch for further processing. + * Launch Spring Batch jobs, with the message headers as the job parameters. * * Generated by camel build tools - do NOT edit this file! */ @@ -45,8 +45,10 @@ public interface SpringBatchEndpointBuilderFactory { } /** - * Explicitly defines if the jobName should be taken from the headers - * instead of the URI. + * Whether the producer takes the name of the job to launch from the + * CamelSpringBatchJobName header of each message instead of the jobName + * path, and looks the job up for every message. The exchange fails when + * the header is missing. When false, that header is ignored. * * The option is a: <code>boolean</code> type. * @@ -61,8 +63,10 @@ public interface SpringBatchEndpointBuilderFactory { return this; } /** - * Explicitly defines if the jobName should be taken from the headers - * instead of the URI. + * Whether the producer takes the name of the job to launch from the + * CamelSpringBatchJobName header of each message instead of the jobName + * path, and looks the job up for every message. The exchange fails when + * the header is missing. When false, that header is ignored. * * The option will be converted to a <code>boolean</code> type. * @@ -77,7 +81,10 @@ public interface SpringBatchEndpointBuilderFactory { return this; } /** - * Explicitly specifies a JobLauncher to be used. + * The JobLauncher that runs the job, instead of the jobLauncher of the + * component. When neither is set, the endpoint uses the single + * JobLauncher of the registry and fails to start when there is none or + * more than one. * * The option is a: * <code>org.springframework.batch.core.launch.JobLauncher</code> type. @@ -92,7 +99,10 @@ public interface SpringBatchEndpointBuilderFactory { return this; } /** - * Explicitly specifies a JobLauncher to be used. + * The JobLauncher that runs the job, instead of the jobLauncher of the + * component. When neither is set, the endpoint uses the single + * JobLauncher of the registry and fails to start when there is none or + * more than one. * * The option will be converted to a * <code>org.springframework.batch.core.launch.JobLauncher</code> type. @@ -107,7 +117,9 @@ public interface SpringBatchEndpointBuilderFactory { return this; } /** - * Explicitly specifies a JobRegistry to be used. + * The JobRegistry in which the job is looked up by its name, instead of + * the jobRegistry of the component. A job that is not in it is looked + * up in the Camel registry as a Job bean. * * The option is a: * <code>org.springframework.batch.core.configuration.JobRegistry</code> @@ -123,7 +135,9 @@ public interface SpringBatchEndpointBuilderFactory { return this; } /** - * Explicitly specifies a JobRegistry to be used. + * The JobRegistry in which the job is looked up by its name, instead of + * the jobRegistry of the component. A job that is not in it is looked + * up in the Camel registry as a Job bean. * * The option will be converted to a * <code>org.springframework.batch.core.configuration.JobRegistry</code> @@ -201,7 +215,8 @@ public interface SpringBatchEndpointBuilderFactory { public interface SpringBatchBuilders { /** * Spring Batch (camel-spring-batch) - * Send messages to Spring Batch for further processing. + * Launch Spring Batch jobs, with the message headers as the job + * parameters. * * Category: workflow * Since: 2.10 @@ -214,7 +229,8 @@ public interface SpringBatchEndpointBuilderFactory { } /** * Spring Batch (camel-spring-batch) - * Send messages to Spring Batch for further processing. + * Launch Spring Batch jobs, with the message headers as the job + * parameters. * * Category: workflow * Since: 2.10 @@ -223,7 +239,10 @@ public interface SpringBatchEndpointBuilderFactory { * Syntax: <code>spring-batch:jobName</code> * * Path parameter: jobName (required) - * The name of the Spring Batch job located in the registry. + * The name of the Spring Batch job to launch. When the endpoint starts, + * the job is looked up in the jobRegistry, when one is set, and else in + * the Camel registry as a Job bean; the endpoint fails to start when + * the job is not found. Not used when jobFromHeader is true. * * @param path jobName * @return the dsl builder @@ -233,7 +252,8 @@ public interface SpringBatchEndpointBuilderFactory { } /** * Spring Batch (camel-spring-batch) - * Send messages to Spring Batch for further processing. + * Launch Spring Batch jobs, with the message headers as the job + * parameters. * * Category: workflow * Since: 2.10 @@ -242,7 +262,10 @@ public interface SpringBatchEndpointBuilderFactory { * Syntax: <code>spring-batch:jobName</code> * * Path parameter: jobName (required) - * The name of the Spring Batch job located in the registry. + * The name of the Spring Batch job to launch. When the endpoint starts, + * the job is looked up in the jobRegistry, when one is set, and else in + * the Camel registry as a Job bean; the endpoint fails to start when + * the job is not found. Not used when jobFromHeader is true. * * @param componentName to use a custom component name for the endpoint * instead of the default name @@ -265,8 +288,10 @@ public interface SpringBatchEndpointBuilderFactory { public static final SpringBatchHeaderNameBuilder INSTANCE = new SpringBatchHeaderNameBuilder(); /** - * The name of the Batch Job to use. Only used when the endpoint has - * jobFromHeader=true. + * The name of the Spring Batch job to launch for this message, looked + * up like the jobName path. Only read when the endpoint has + * jobFromHeader=true. Like every other header, it is also passed to the + * job as a job parameter. * * The option is a: {@code String} type. * diff --git a/tasks/component-descriptions.md b/tasks/component-descriptions.md index 11e780dd4b3b..0ab736f86443 100644 --- a/tasks/component-descriptions.md +++ b/tasks/component-descriptions.md @@ -348,7 +348,7 @@ or removes its row. | camel-spring-ai-embeddings | spring-ai-embeddings | | | camel-spring-ai-image | spring-ai-image | | | camel-spring-ai-vector-store | spring-ai-vector-store | yes | -| camel-spring-batch | spring-batch | | +| camel-spring-batch | spring-batch | yes | | camel-spring-jdbc | spring-jdbc | | | camel-spring-ldap | spring-ldap | | | camel-spring-rabbitmq | spring-rabbitmq | |
