gnodet opened a new pull request, #31238: URL: https://github.com/apache/camel/pull/31238
## Summary Two independent bugs in `camel-salesforce` where endpoint configuration values are either invisible to the processor or mutated across exchanges. ## Root Cause **Bug 1 — pkChunking options have no effect** `SalesforceEndpointConfig.toValueMap()` populates the map that all processors read via `getParameter()`. The four PK chunking fields (`pkChunking`, `pkChunkingChunkSize`, `pkChunkingParent`, `pkChunkingStartRow`) were simply never added to that map, so `BulkApiProcessor.determineHeaders()` always found `null` for them regardless of what was configured on the endpoint. The `Sforce-Enable-PKChunking` request header was therefore never set. **Bug 2 — approval header values bleed across exchanges** `AbstractRestProcessor.processApproval()` retrieved the `ApprovalRequest` object from the endpoint config map and handed it directly to `processApprovalHeaderValues()`, which uses reflection to mutate it (`setPropertyValue()`). Because the config map is shared across all exchanges processed by the same endpoint instance, the first exchange's `approval.*` message headers permanently modified the shared `ApprovalRequest`, bleeding into every subsequent exchange. ## Fix **Bug 1:** Add `PK_CHUNKING`, `PK_CHUNKING_CHUNK_SIZE`, `PK_CHUNKING_PARENT`, and `PK_CHUNKING_START_ROW` to the bulk-API section of `SalesforceEndpointConfig.toValueMap()`. **Bug 2:** In `processApproval()`, create a per-exchange copy of the retrieved `ApprovalRequest` via `new ApprovalRequest().applyTemplate(r)` before passing it to `processApprovalHeaderValues()`. Mutations now stay scoped to the exchange. ## Tests - `SalesforceEndpointConfigToValueMapTest` — asserts that all four PK chunking fields appear in `toValueMap()` both when set and when unset. - `AbstractRestProcessorApprovalTest#approvalTemplateFromEndpointConfigShouldNotBleedAcrossExchanges` — sends two sequential exchanges through the same processor; the second exchange must not inherit `approval.Comments` written by the first. Fixes CAMEL-28015 --- _Hermes Agent (Claude Sonnet 4.6) on behalf of Guillaume Nodet_ -- 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]
