You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "Croway (via GitHub)" <gi...@apache.org> on 2026/07/16 16:02:32 UTC
[PR] [backport camel-4.18.x] CAMEL-24187: CamelContext.getEndpoint() never caches a uri containing a % character [camel]
Croway opened a new pull request, #24808:
URL: https://github.com/apache/camel/pull/24808
## Summary
Backport of #24805 to `camel-4.18.x` (excludes the camel-plc4x test).
- `AbstractCamelContext.doGetEndpoint()` normalizes the URI once for cache lookup, but on a cache miss passes the already-normalized URI to `addEndpointToRegistry()`, which normalizes it a **second** time. Since `EndpointHelper.normalizeEndpointUri()` is not idempotent for URIs containing `%` (each pass encodes `%41` → `%2541`), the stored registry key never matches a later lookup key — causing `getEndpoint()` to create a brand-new `Endpoint` on every call instead of reusing the cached singleton.
- Adds a `normalized`-aware overload of `getEndpointKey()`/`addEndpointToRegistry()` so the `doGetEndpoint()` call site skips redundant re-normalization. Public APIs (`hasEndpoint`, `addEndpoint`, `removeEndpoints`) are unchanged.
- Affects any component whose endpoint URI contains a literal `%` and is re-resolved by string (`pollEnrich`/`toD`/`recipientList`).
## Test plan
- [x] New test `DefaultEndpointRegistryTest#testGetEndpointIsCachedForUriContainingPercentCharacter` verifies the fix using `controlbus:route?routeId=RAW(%41)&action=status`.
_Claude Opus 4.6 on behalf of Croway_
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [backport camel-4.18.x] CAMEL-24187: CamelContext.getEndpoint() never caches a uri containing a % character [camel]
Posted by "Croway (via GitHub)" <gi...@apache.org>.
Croway merged PR #24808:
URL: https://github.com/apache/camel/pull/24808
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org