atiaomar1978-hub opened a new pull request, #25034:
URL: https://github.com/apache/camel/pull/25034

   # CAMEL-24245: Add camel-clickhouse component
   
   This adds a new **producer-only** `camel-clickhouse` component that 
integrates with
   [ClickHouse](https://clickhouse.com/), the high-performance columnar OLAP 
database, using the official
   ClickHouse Java client (`com.clickhouse:client-v2`). It follows the 
`camel-influxdb2` layout (a dedicated
   component on a vendor client, rather than generic JDBC), as proposed in
   [CAMEL-24245](https://issues.apache.org/jira/browse/CAMEL-24245).
   
   ## Why a dedicated component (vs camel-jdbc)
   
   Camel can already reach ClickHouse through `camel-jdbc` / `camel-sql`, but 
only over the JDBC
   `PreparedStatement` path. This component exposes ClickHouse's native 
capabilities as first-class endpoint
   options: native format streaming inserts (`RowBinary`, `JSONEachRow`, `CSV`, 
`TSV`, `Parquet`), server-side
   asynchronous inserts, OLAP queries and health checks.
   
   ```
   clickhouse://analytics.events?operation=insert&format=RowBinary
   ```
   
   ## What's included
   
   - **`camel-clickhouse` component** — `ClickHouseComponent`, 
`ClickHouseEndpoint`, `ClickHouseProducer`,
     `ClickHouseConstants`, `ClickHouseOperation` and `ClickHouseException`.
     - Operations: `insert` (default), `query`, `ping`.
     - Insert body types: `InputStream`, `byte[]`, `String`, `java.io.File` 
(streamed to the server using the
       configured `format`), or a `List` for the native list-insert API.
     - Connectivity: a shared autowired `com.clickhouse.client.api.Client` 
bean, or `serverUrl` /
       `username` / `password` / `ssl` endpoint options (the client is built 
lazily).
     - Options: `operation`, `format`, `batchSize`, `asyncInsert`, 
`waitForAsyncInsert`, `compression`.
     - Headers: `CamelClickHouseOperation`, `CamelClickHouseDatabase`, 
`CamelClickHouseTable`,
       `CamelClickHouseFormat`, `CamelClickHouseWrittenRows`, 
`CamelClickHouseReadRows`,
       `CamelClickHousePingOk`.
   - **`camel-test-infra-clickhouse`** — a new Testcontainers-based test-infra 
module (image pulled from
     `mirror.gcr.io/clickhouse/clickhouse-server`).
   - **Tests** — AssertJ unit tests (`ClickHouseComponentTest`, 
`ClickHouseProducerTest`, mocking the client)
     and a Testcontainers integration test (`ClickHouseProducerIT`).
   - **Docs** — `clickhouse-component.adoc` and an entry in the 4.22 upgrade 
guide.
   - Wiring in `components/pom.xml`, `parent/pom.xml`, `bom/camel-bom/pom.xml`,
     `catalog/camel-allcomponents/pom.xml`, `test-infra/pom.xml`, 
`camel-test-infra-all` and the catalog
     metadata.
   
   ## Testing
   
   - `mvn test -pl components/camel-clickhouse` — 15 unit tests pass.
   - The `*IT` integration test runs under Testcontainers (Docker required) and 
is executed by CI; it was not
     run locally as Docker was unavailable in the dev environment.
   - `mvn install -Psourcecheck` passes for both new modules (formatter + 
import sort clean).
   
   ---
   
   _This PR was generated by Cursor Agent on behalf of @atiaomar1978-hub._
   


-- 
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