oscerd opened a new pull request, #1859:
URL: https://github.com/apache/camel-kafka-connector/pull/1859

   Fixes #1724.
   
   ### Problem
   
   The `webhook-source` Kamelet only declares `camel-platform-http`, which has 
no HTTP server of its own. Every published 
`camel-webhook-source-kafka-connector` package, from 1.0.0 to 4.22.0, therefore 
fails at task start. Reproduced with the released 4.22.0 package:
   
   ```
   FailedToStartComponentException: Failed to start component platform-http 
because of No platform-http-engine service could be found in the classpath. Add 
camel-platform-http-vertx to classpath.
   ```
   
   ### Change
   
   - **Ship the server.** 
`camel-kafka-connector-kamelet-fix-dependencies.properties` adds 
`camel-webhook-source=org.apache.camel:camel-platform-http-main`, the embedded 
Vert.x HTTP server of Camel Main. The connector pom is regenerated from it. The 
package gains 26 jars (camel-platform-http-main/-vertx, camel-vertx-common, 
camel-attachments, Vert.x, Netty) and loses none.
   - **Server stays opt-in.** It starts only with `camel.server.enabled=true` 
and is configured with `camel.server.port` / `host` / `path`. It stays off by 
default so that installing the connector doesn't open an unauthenticated 
listener on `0.0.0.0:8080`. Making it default-on would take one more line in 
the same properties file (`additional_properties_camel-webhook-source=...`); 
that's a maintainer call.
   - **New user guide page.** `user-guide/webhook-source.adoc`, linked from the 
nav and from the troubleshooting page. It covers:
     - the server options and a complete example configuration;
     - deployment: `tasks.max=1`, one port per webhook connector, and the 
listener runs on (and moves with) the worker that runs the task;
     - security: network exposure, basic auth or JWT, TLS via `camel.ssl.*`, 
`maxBodySize`, header hygiene per the Security Model;
     - troubleshooting for the three possible error messages, with a workaround 
for 4.22.0.
   - **Integration test.** New `tests/itests-webhook`. It starts the connector 
with the server on a free port bound to `127.0.0.1`, POSTs to it (retried with 
Awaitility, no `Thread.sleep`), and checks the Kafka record value and its 
`CamelHeader.CamelHttpPath` header. The module depends on the connector as 
`<type>pom</type>`, so the test classpath has exactly the dependencies the 
connector declares. The test therefore fails if the package stops shipping the 
server.
   
   The page describes the record value as a `byte[]`, which is the behaviour 
after #1852 (#1543). Please merge that PR first.
   
   ### Verification
   
   - The itest passes. With the fix removed it fails as expected (`No 
platform-http-server service ... Add camel-platform-http-main`).
   - Under heavy load, the test harness's fixed 30s Kafka Connect startup can 
time out before any test runs. The existing `itests-timer` does the same on 
that machine, and CI retries failing tests.
   - A task on the fixed package was also checked by hand:
     - a POST becomes one record;
     - the HTTP response returns 200 once the record is committed;
     - HTTPS via `camel.ssl.*` works;
     - basic auth returns 401 without credentials and 200 with them;
     - the keystore password is masked in CKC's startup log.
   - `-Psourcecheck` is clean on the connector and the new itest module, and 
the full reactor build `./mvnw clean verify -DskipTests` succeeds.
   
   _Claude Code on behalf of Andrea Cosentino_
   
   🤖 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