nzw921rx opened a new pull request, #11158: URL: https://github.com/apache/seatunnel/pull/11158
## Purpose of this pull request Related #11007 Depends on #11121 1. Add `greaterOrEqual(START_MODE_TIMESTAMP, 0L)` constraint when `start.mode = CONSUME_FROM_TIMESTAMP` 2. Add `mapNotEmpty(START_MODE_OFFSETS)` constraint when `start.mode = CONSUME_FROM_SPECIFIC_OFFSETS` 3. Add `TableConfigsValidator` (`ConditionExtension`) to validate nested `tables_configs` / `table_list` entries: topics non-empty, per-entry start.mode conditional dependencies, timestamp >= 0, offsets non-empty 4. Remove migrated imperative checks from `RocketMqSourceConfig`, retain runtime-only `> currentTimestamp` checks with comments 5. Add `RocketMqFactoryTest` covering single-table and multi-table positive/negative validation paths ## Does this PR introduce _any_ user-facing change? Yes — previously invalid configurations (negative timestamps, empty offsets, missing topics in tables_configs entries) were rejected at task execution time with generic `IllegalArgumentException`. Now they are rejected earlier at job submission time with structured `OptionValidationException` including option name, constraint type, and violation details. Multiple errors are reported together thanks to the aggregation support from #11121. ## How was this patch tested? Unit tests in `RocketMqFactoryTest`: - `testValidTimestampConfig` — valid CONSUME_FROM_TIMESTAMP mode passes validation - `testNegativeTimestampRejected` — negative `start.mode.timestamp` is rejected - `testValidSpecificOffsetsConfig` — valid CONSUME_FROM_SPECIFIC_OFFSETS mode passes validation - `testEmptyOffsetsMapRejected` — empty offsets map is rejected - `testMultiTableValidConfig` — valid multi-table config passes validation - `testMultiTableMissingTopicsRejected` — empty topics in tables_configs entry is rejected - `testMultiTableTimestampModeWithoutTimestampRejected` — TIMESTAMP mode without timestamp in entry is rejected - `testMultiTableNegativeTimestampRejected` — negative timestamp in tables_configs entry is rejected - `testMultiTableEmptyOffsetsRejected` — empty offsets in tables_configs entry is rejected Existing tests continue to pass. ```bash ./mvnw test -pl seatunnel-connectors-v2/connector-rocketmq -Dtest="RocketMqFactoryTest" -DfailIfNoTests=false ``` -- 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]
