Claus Ibsen created CAMEL-27808:
-----------------------------------
Summary: camel-workday: report parameters are not URL-encoded,
connection pools and HTTP clients are never closed
Key: CAMEL-27808
URL: https://issues.apache.org/jira/browse/CAMEL-27808
Project: Camel
Issue Type: Bug
Components: camel-workday
Reporter: Claus Ibsen
Fix For: 4.25.0
Found while improving the option descriptions of camel-workday for CAMEL-23832
(pull request https://github.com/apache/camel/pull/31138).
These are separate problems of the component; the descriptions change only
documents the current behavior.
h4. 1. Report parameters are not URL-encoded
{{WorkdayReportProducer.prepareUri}} joins the endpoint parameters that are not
component options as {{k + "=" + v}}. Camel has already decoded them from the
endpoint URI, so a value with a space, &, # or % makes {{new HttpGet(String)}}
fail or splits into extra parameters.
Proposed change: encode them (URIBuilder.addParameter or
URISupport.createQueryString).
h4. 2. Connection pools and HTTP clients are never closed
By default each endpoint gets a new PoolingHttpClientConnectionManager that is
never closed (no doStop), and {{WorkdayDefaultProducer.process}} builds a new
CloseableHttpClient per exchange and never closes it.
Proposed change: build the client in doStart and close the default pool in the
endpoint's doStop when the component created it.
h4. 3. A new access token for every exchange
The refresh_token grant runs before every exchange, so each call makes two HTTP
requests; caching the token until it expires would halve that.
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)