You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "oscerd (via GitHub)" <gi...@apache.org> on 2026/07/09 10:25:19 UTC

[PR] Eliminate generated Task classes from connector modules [camel-kafka-connector]

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

   ## Summary
   
   - Eliminates 193 generated Task files (~6,800 lines of boilerplate) from connector modules
   - Reduces per-connector generated Java classes from 3 (Connector + Task + ConnectorConfig) to 2 (Connector + ConnectorConfig)
   - Introduces `getConnectorDefaults()` hook in base Connector classes to pass component/kamelet defaults through task configs
   - Adds `camel.sink.kamelet` / `camel.source.kamelet` config properties so the kamelet URI flows through configuration instead of requiring a Task subclass override
   
   Closes #1787
   
   ## Changes
   
   **Core module (6 files):**
   - `CamelSinkConnectorConfig` / `CamelSourceConnectorConfig` — new `camel.{sink,source}.kamelet` config keys
   - `CamelSinkConnector` / `CamelSourceConnector` — new `getConnectorDefaults()` hook, `taskConfigs()` merges defaults
   - `CamelSinkTask` / `CamelSourceTask` — read kamelet from config, deprecate `getSinkKamelet()`/`getSourceKamelet()`
   
   **Generator plugin (2 files):**
   - `CamelKafkaConnectorUpdateMojo` — stop generating Task classes, generate `getConnectorDefaults()` in Connector
   - `CamelKafkaConnectorKameletUpdateMojo` — same for kamelet connectors
   
   **Connector modules (565 files):**
   - 193 generated Task files deleted
   - 193 generated Connector files simplified (removed `taskClass()`, added `getConnectorDefaults()`)
   - Kamelet YAMLs updated from regeneration
   - Syslog hand-written Tasks updated to extend base classes directly (previously extended deleted `CamelNetty*Task`)
   
   ## Backward Compatibility
   
   - `getSinkKamelet()` / `getSourceKamelet()` — deprecated but functional; custom subclass overrides still take effect
   - `getDefaultConfig()` / `getCamelSinkConnectorConfig()` — unchanged in base classes; custom connectors still work
   - `connector.class` FQCNs — unchanged; no user configuration changes needed
   
   ## Test plan
   
   - [x] Core module unit tests pass (`mvn verify -pl core`)
   - [x] Catalog module tests pass (`mvn verify -pl camel-kafka-connector-catalog`)
   - [x] Connector module compilation verified (file, aws-s3-sink, syslog, netty, log-sink, timer-source)
   - [x] File integration tests pass (6/6) — component-based sink connector
   - [x] Timer integration tests pass (1/1) — kamelet-based source connector
   - [x] Syslog integration tests pass (2/2) — hand-written connector
   - [x] Netty integration tests pass (4/4) — component-based bidirectional connector
   
   🤖 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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Eliminate generated Task classes from connector modules [camel-kafka-connector]

Posted by "oscerd (via GitHub)" <gi...@apache.org>.
oscerd merged PR #1788:
URL: https://github.com/apache/camel-kafka-connector/pull/1788


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