lizhimins opened a new pull request, #158: URL: https://github.com/apache/rocketmq-flink/pull/158
### Motivation Step 3 of #155. #157 made the codebase new-API only, so supporting Flink 2.x is now just the version switch. This makes `main` the 2.x line, the same shape `apache/flink-connector-kafka` uses (2.x on `main`, 1.x on a maintenance branch). The 1.x line already exists: branch [`v3.0`](https://github.com/apache/rocketmq-flink/tree/v3.0) points at the #157 merge commit `0b3ae9d` (Flink 1.20.3 / Java 11). **The diff between the two lines is exactly this commit**, so a fix cherry-picks both ways without adaptation in the shared code. ### Changes - `flink.version` 1.20.3 -> 2.2.1, `target.java.version` / compiler `release` 11 -> 17. - Drop the deprecated-overload bridges that only 1.20 needs (`Sink.InitContext` + `InitContextAdapter` in `RocketMQSink` / `RocketMQGrpcSink`, `createSerializer(ExecutionConfig)` in `AckableMessageTypeInfo`): 2.x declares the `WriterInitContext` / `SerializerConfig` overloads abstract, and 1.20 calls those overloads at runtime too, so the bridges only served callers still passing the old context types. - `RocketMQGrpcITCase` collects with `sink.legacy.RichSinkFunction`, the 2.x package (1.20 has no `sink.legacy` subpackage). - CI: the build matrix drops JDK 11 (Flink 2.x requires Java 17 at compile time). But spotless 2.27.1 **silently skips** its Java formatter on JDK 16+ (the log line is `Spotless check skipped`), so keeping `spotless:check` inside the JDK 17 job would have dropped the only style gate that actually runs. It moves to a dedicated JDK 11 job — formatting does not compile against Flink, so it can stay on 11. ### Verification - `mvn -B clean package` green on JDK 17: 146 remoting (4 skipped) + 80 grpc unit tests, 0 failures; both SQL fat-jars produced. - `mvn -B spotless:check` green on JDK 11 (this is the leg that actually formats). - End to end on a Flink 2.2.1 K8s Application-mode cluster (official `flink:2.2.1-scala_2.12-java17` base, `flink-oss-fs-hadoop-2.2.1`, checkpoint/savepoint to OSS): 1000 x 4KB passthrough reconciles 1001/1001 against broker physical offsets with 0 missing / 0 unexpected / 0 duplicate, on both a direct nameserver deployment and a proxy deployment; startup-offset (latest / timestamp / specific), tag and SQL92 filter cases match the expected id sets exactly; transactional sink commits 101/101 on the direct deployment at both 10s and 45s checkpoint intervals; TM/JM deletion, broker kill and a 60s nameserver outage all recover with 0 missing (the job stays RUNNING with a single JobID, no split re-assignment). ### Note for the next release Both lines currently carry project version `3.0.0`, so the two artifacts would collide on the same GAV with different content. Following the Kafka convention, release artifacts should carry the Flink version as a second segment (`3.0.0-1.20` from `v3.0`, `3.0.0-2.2` from `main`). -- 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]
