allthingssecurity opened a new pull request, #27393: URL: https://github.com/apache/camel/pull/27393
# Description [CAMEL-25317](https://issues.apache.org/jira/browse/CAMEL-25317) `Iso8583DataFormat.unmarshal` took the ISO header length from `MessageFactory.getIsoHeader` and threw `IsoType ... is not known in the MessageFactory configuration file` when it returned `null`. In j8583 the header of a message type is optional, and a binary header is only returned by `getBinaryIsoHeader`, so every message of a type without a text header could not be unmarshalled, even with a parse guide (the module's own test configuration has several such types, among them 0600). This change skips the binary header when the type has one, the text header otherwise, and nothing when the type has no header. Types with a text header are parsed as before. A configured type that does not match the data now fails in j8583's parser (`ParseException: ... no parsing guide for message type ...`, as on main for a mismatched type with a text header) instead of with the "not known" error. Tests: new `Iso8583DataFormatIsoHeaderTest` (no header and binary header fail without the change, text header is the control); module: 7 tests pass. Found with a Lean 4 model: the round trip `unmarshal(writeData(header, message))` fails on main for every type without a text header and is proved for the fix for all three header kinds. # Target - [x] I checked that the commit is targeting the correct branch (Camel 4 uses the `main` branch) # Tracking - [x] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it). # Apache Camel coding standards and style - [x] I checked that each commit in the pull request has a meaningful subject line and body. - [ ] I have run `mvn clean install -DskipTests` locally from root folder and I have committed all auto-generated changes. (I built and tested the affected module, including the formatter and import-sort plugins. I did not run the full root build.) # AI-assisted contributions - [x] If this PR includes AI-generated code, commits have proper co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR description identifies the AI tool used. This PR was prepared with Claude Code (Claude Opus 5.5). The commit carries a `Co-Authored-By` trailer. _Claude Code on behalf of allthingssecurity_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
