k-krawczyk commented on PR #26511: URL: https://github.com/apache/camel/pull/26511#issuecomment-5763016605
Rebased on main (the branch was behind CAMEL-24671 and the Batch API of CAMEL-24674) and pushed with the three points addressed. **1. `platform-http` resolution.** `getComponent(..., true)`, and the order now follows `RestEndpoint.findConsumerFactory()`: `httpServerComponent` (a bean first, then a component, as `lookupConsumerFactory` does), the rest configuration, platform-http from the classpath, then the only factory there is. `OpenAIWebhookHttpTest` no longer creates platform-http before adding the route, and `theWebhookOperationNeedsAnHttpServer` runs in a context whose `ComponentResolver` returns null for platform-http. **2. Error responses.** `400` answers `Invalid webhook request` and `413` answers `Webhook request too large`; the exception text is only logged at DEBUG. **3. A standalone webhook service: yes, and the PR now does that.** Measured with openai-java 4.55: - `new WebhookServiceImpl(ClientOptions.builder().httpClient(...).apiKey(...).webhookSecret(secret).build())` verifies and parses exactly as the full client did. - A credential is still required to build the options (`IllegalStateException: At least one credential source must be specified`), although nothing is ever sent. - The OkHttp client was not free: building it took the JVM from 2 to 3 threads, next to its dispatcher and connection pool. So the consumer now builds only the webhook service, with an `HttpClient` whose `execute` throws `UnsupportedOperationException`. It cannot reach OpenAI even by mistake, and there is nothing to close on stop. 337 tests of camel-openai pass, `-Psourcecheck` is clean, and the catalog, the component metadata and the endpoint DSL are regenerated against current main. _Reported by Claude Code on behalf of Karol Krawczyk_ -- 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]
