[
https://issues.apache.org/jira/browse/CAMEL-26122?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen reassigned CAMEL-26122:
-----------------------------------
Assignee: Claus Ibsen
> camel-spring-batch - a message header with a null value fails the job launch
> ----------------------------------------------------------------------------
>
> Key: CAMEL-26122
> URL: https://issues.apache.org/jira/browse/CAMEL-26122
> Project: Camel
> Issue Type: Bug
> Components: camel-spring-batch
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 4.24.0
>
>
> Found while adding the catalog body types of flink, spring-batch and
> optaplanner (CAMEL-24961, PR #28418).
> h4. 1. A header with a null value fails the job launch
> {{SpringBatchProducer}} turns every message header into a job parameter; for
> a null value it calls {{parametersBuilder.addString(headerKey, null)}} (main
> 2a465aa4814c, line 106), with a comment saying this avoids an NPE. Spring
> Batch 6 rejects a null value, so any exchange with a null header fails "Value
> for parameter 'nullHeader' must not be null". Checked on 4.24.0-SNAPSHOT with
> an in-memory {{ResourcelessJobRepository}} and a tasklet job.
> Proposed: skip headers with a null value (and fix the comment).
> h4. 2. jobFromHeader=false does not stop the job name header
> {{SpringBatchProducer}} (main 2a465aa4814c, lines 56-72) takes the job name
> from the {{CamelSpringBatchJobName}} header even with
> {{jobFromHeader=false}}, so the header picks which registered Job is launched
> although the option says it should not. Checked on 4.24.0-SNAPSHOT with an
> in-memory job repository.
> Proposed: read the job name header only with {{jobFromHeader=true}}.
> _Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)