vignesh-manel opened a new pull request, #28690:
URL: https://github.com/apache/camel/pull/28690

   # Description
   
   Fixes [CAMEL-26130](https://issues.apache.org/jira/browse/CAMEL-26130).
   
   `OAIPMHProducer` copied the `CamelOaimphOnlyFirst` and 
`CamelOaimphIgnoreSSLWarnings` headers onto the endpoint 
(`endpoint::setOnlyFirst`, `endpoint::setIgnoreSSLWarnings`). The endpoint is 
shared by every exchange sent to that URI, so:
   
   - after one exchange with `CamelOaimphOnlyFirst=true`, every later exchange 
without the header returned only the first page. Reproduced with 
`MockOaipmhServer`: 6 pages, then 1, then 1 again;
   - after one exchange with `CamelOaimphIgnoreSSLWarnings=true`, every later 
exchange accepted a self-signed certificate. The ticket only mentions "the 
other headers copied onto the endpoint"; this was the only other one.
   
   The producer now reads both headers for the exchange only, and falls back to 
the endpoint's `onlyFirst` / `ignoreSSLWarnings` options when the header is 
absent. A header set to `false` still turns the option off for that exchange, 
as before. Nothing writes to the endpoint any more. The other headers already 
went to the `Harvester` created for each exchange.
   
   Tests: the new `OAIPMHProducerHeadersPerExchangeTest` has two tests, one per 
header. Each sends one exchange with the header and then one without it to the 
same endpoint. Both tests failed before the fix: `expected: <6> but was: <1>`, 
and "Expected CamelExecutionException to be thrown, but nothing was thrown". 
The existing only-first tests (which set the header on every iteration) still 
pass.
   
   Upgrade guide: a short entry in 4.24, placed after the camel-aws2-kinesis 
per-endpoint entry, for routes that relied on the header sticking to the 
endpoint.
   
   Local: `mvn clean install -Psourcecheck` in `components/camel-oaipmh`, 13 
tests, 0 failures; no generated files changed.
   
   _Claude Code on behalf of vignesh-manel_
   
   # 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.
   
   - [x] I have run `mvn clean install -DskipTests` locally from root folder 
and I have committed all auto-generated changes. (Run in the module with 
`-Psourcecheck`, not from the root; no generated files changed. CI checks the 
rest.)
   
   # 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.
   
   🤖 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]

Reply via email to