Skip to content

Commit cbd1621

Browse files
committed
Revert spring-kafka 2.4-2.9 extension and update skill docs
Spring Kafka 2.4+ requires kafka-clients 2.4+, but the test scenario uses kafka-clients 2.3.1 (Consumer.committed(Set) NoSuchMethodError). Extending 2.4+ needs separate scenarios with version-matched kafka-clients. Also add source code cloning workflow and import-time failure check to the plugin development skill.
1 parent 6cbeea6 commit cbd1621

4 files changed

Lines changed: 23 additions & 12 deletions

File tree

.claude/skills/new-plugin/SKILL.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,26 @@ When assessing whether a plugin works with a new library version, or when choosi
138138
3. Do the witness classes still correctly distinguish versions? (a witness class that exists in both old and new versions won't prevent the plugin from loading on an incompatible version)
139139
4. Do the runtime APIs called by the interceptor still exist? (e.g., calling `cluster.getDescription()` will crash if that method was removed, even if the plugin loaded successfully)
140140

141-
**How to verify:**
142-
- Fetch the actual source file from the library's Git repository at the specific version tag (e.g., `https://raw.githubusercontent.com/{org}/{repo}/{tag}/path/to/Class.java`)
143-
- Or download the specific JAR and inspect the class
144-
- Or add the version to the plugin's test dependencies and compile
141+
**How to verify — clone the library source locally:**
142+
```bash
143+
# Clone specific version tag to /tmp for easy source code inspection
144+
cd /tmp && git clone --depth 1 --branch {tag} https://github.com/{org}/{repo}.git {local-name}
145+
146+
# Examples:
147+
git clone --depth 1 --branch r4.9.0 https://github.com/mongodb/mongo-java-driver.git mongo-4.9
148+
git clone --depth 1 --branch v2.4.13.RELEASE https://github.com/spring-projects/spring-kafka.git spring-kafka-2.4
149+
150+
# Then grep/read the actual source files to check class/method existence
151+
grep -rn "getFilter\|getWriteRequests" /tmp/mongo-4.9/driver-core/src/main/com/mongodb/internal/operation/
152+
```
153+
154+
This is faster and more reliable than fetching individual files via raw GitHub URLs. You can `grep`, `diff` between versions, and trace the full execution path.
155+
156+
**Also check for import-time class loading failures:**
157+
If a plugin helper class (not just the instrumentation class) imports a library class that was removed, the entire helper class will fail to load with `NoClassDefFoundError` at runtime. This silently breaks ALL functionality in that helper — not just the code paths using the removed class. Verify that every `import` statement in plugin support classes resolves to an existing class in the target version.
145158

146159
**Real examples of why this matters:**
160+
- MongoDB driver 4.9 removed `InsertOperation`, `DeleteOperation`, `UpdateOperation``MongoOperationHelper` imported all three, causing the entire class to fail loading with `NoClassDefFoundError`, silently losing ALL `db.bind_vars` tags even for operations that still exist (like `FindOperation`, `AggregateOperation`)
147161
- MongoDB driver 4.11 removed `Cluster.getDescription()` — the plugin loads (witness classes pass) but crashes at runtime with `NoSuchMethodError`
148162
- Feign 12.2 moved `ReflectiveFeign$BuildTemplateByResolvingArgs` to `RequestTemplateFactoryResolver$BuildTemplateByResolvingArgs` — the path variable interception silently stops working
149163
- MariaDB 3.0 renamed every JDBC wrapper class (`MariaDbConnection``Connection`) — none of the plugin's `byName` matchers match anything

CHANGES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Release Notes.
1515
* Extend Feign plugin to support OpenFeign 10.x, 11.x, 12.1.
1616
* Extend Undertow plugin to support Undertow 2.1.x, 2.2.x, 2.3.x.
1717
* Extend GraphQL plugin to support graphql-java 18 -> 24 (20+ requires JDK 17).
18-
* Extend Spring Kafka plugin to support Spring Kafka 2.4 -> 2.9 and 3.0 -> 3.3.
18+
* Extend Spring Kafka plugin to support Spring Kafka 3.0 -> 3.3.
1919

2020
All issues and pull requests are [here](https://github.com/apache/skywalking/milestone/249?closed=1)
2121

docs/en/setup/service-agent/java-agent/Supported-list.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ metrics based on the tracing data.
7777
* [RocketMQ](https://github.com/apache/rocketmq) 3.x-> 5.x
7878
* [RocketMQ-gRPC](http://github.com/apache/rocketmq-clients) 5.x
7979
* [Kafka](http://kafka.apache.org) 0.11.0.0 -> 3.9.1
80-
* [Spring-Kafka](https://github.com/spring-projects/spring-kafka) Spring Kafka Consumer 1.3.x -> 3.3.x (2.0.x and 2.1.x not tested and not recommended by [the official document](https://spring.io/projects/spring-kafka))
80+
* [Spring-Kafka](https://github.com/spring-projects/spring-kafka) Spring Kafka Consumer 1.3.x -> 2.3.x, 3.0.x -> 3.3.x (2.0.x and 2.1.x not tested and not recommended by [the official document](https://spring.io/projects/spring-kafka))
8181
* [ActiveMQ](https://github.com/apache/activemq) 5.10.0 -> 5.15.4
8282
* [RabbitMQ](https://www.rabbitmq.com/) 3.x-> 5.x
8383
* [Spring-RabbitMQ](https://github.com/spring-projects/spring-amqp) 2.x -> 4.x

test/plugin/scenarios/spring-kafka-2.3.x-scenario/support-version.list

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17+
# Each Spring Kafka minor version requires a matching kafka-clients version.
18+
# 2.4+ needs kafka-clients 2.4+, but this scenario uses kafka-clients 2.3.1.
19+
# Extending to 2.4+ requires separate scenarios with version-matched kafka-clients.
1720
2.3.10.RELEASE
18-
2.4.13.RELEASE
19-
2.5.17.RELEASE
20-
2.6.15
21-
2.7.18
22-
2.8.11
23-
2.9.13

0 commit comments

Comments
 (0)