Skip to content

Commit 5c925be

Browse files
committed
Add E2E test scenario for spring-kafka 3.3.10
1 parent 6d27462 commit 5c925be

File tree

10 files changed

+611
-0
lines changed

10 files changed

+611
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
#
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
19+
home="$(cd "$(dirname $0)"; pwd)"
20+
21+
java -Dbootstrap.servers=${BOOTSTRAP_SERVERS} -jar ${agent_opts} "-Dskywalking.agent.service_name=spring-kafka-3.3.x-scenario" ${home}/../libs/spring-kafka-3.3.x-scenario.jar &
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
segmentItems:
17+
- serviceName: spring-kafka-3.3.x-scenario
18+
segmentSize: nq 0
19+
segments:
20+
- segmentId: not null
21+
spans:
22+
- operationName: Kafka/spring_test/Producer
23+
parentSpanId: 0
24+
spanId: 1
25+
spanLayer: MQ
26+
startTime: not null
27+
endTime: not null
28+
componentId: 40
29+
isError: false
30+
spanType: Exit
31+
peer: kafka-server:9092
32+
skipAnalysis: false
33+
tags:
34+
- {key: mq.broker, value: 'kafka-server:9092'}
35+
- {key: mq.topic, value: spring_test}
36+
- operationName: Kafka/spring_test/Producer
37+
parentSpanId: 0
38+
spanId: 2
39+
spanLayer: MQ
40+
startTime: not null
41+
endTime: not null
42+
componentId: 40
43+
isError: false
44+
spanType: Exit
45+
peer: kafka-server:9092
46+
skipAnalysis: false
47+
tags:
48+
- { key: mq.broker, value: 'kafka-server:9092' }
49+
- { key: mq.topic, value: spring_test }
50+
- operationName: GET:/case/spring-kafka-case
51+
parentSpanId: -1
52+
spanId: 0
53+
spanLayer: Http
54+
startTime: not null
55+
endTime: not null
56+
componentId: 14
57+
isError: false
58+
spanType: Entry
59+
peer: ''
60+
skipAnalysis: false
61+
tags:
62+
- {key: url, value: 'http://localhost:8080/spring-kafka-3.3.x-scenario/case/spring-kafka-case'}
63+
- {key: http.method, value: GET}
64+
- {key: http.status_code, value: '200'}
65+
- segmentId: not null
66+
spans:
67+
- operationName: GET:/case/spring-kafka-consumer-ping
68+
parentSpanId: -1
69+
spanId: 0
70+
spanLayer: Http
71+
startTime: not null
72+
endTime: not null
73+
componentId: 14
74+
isError: false
75+
spanType: Entry
76+
peer: ''
77+
skipAnalysis: false
78+
tags:
79+
- {key: url, value: 'http://localhost:8080/spring-kafka-3.3.x-scenario/case/spring-kafka-consumer-ping'}
80+
- {key: http.method, value: GET}
81+
- {key: http.status_code, value: '200'}
82+
refs:
83+
- {parentEndpoint: 'Kafka/spring_test/Consumer/grop:spring_test', networkAddress: 'localhost:8080',
84+
refType: CrossProcess, parentSpanId: 1, parentTraceSegmentId: not null,
85+
parentServiceInstance: not null, parentService: spring-kafka-3.3.x-scenario,
86+
traceId: not null}
87+
- segmentId: not null
88+
spans:
89+
- operationName: /spring-kafka-3.3.x-scenario/case/spring-kafka-consumer-ping
90+
parentSpanId: 0
91+
spanId: 1
92+
spanLayer: Http
93+
startTime: not null
94+
endTime: not null
95+
componentId: 12
96+
isError: false
97+
spanType: Exit
98+
peer: localhost:8080
99+
skipAnalysis: false
100+
tags:
101+
- {key: http.method, value: GET}
102+
- {key: url, value: 'http://localhost:8080/spring-kafka-3.3.x-scenario/case/spring-kafka-consumer-ping'}
103+
- {key: http.status_code, value: '200'}
104+
- operationName: Kafka/spring_test/Consumer/grop:spring_test
105+
parentSpanId: -1
106+
spanId: 0
107+
spanLayer: MQ
108+
startTime: not null
109+
endTime: not null
110+
componentId: 41
111+
isError: false
112+
spanType: Entry
113+
peer: kafka-server:9092
114+
skipAnalysis: false
115+
tags:
116+
- {key: mq.broker, value: 'kafka-server:9092'}
117+
- {key: mq.topic, value: spring_test}
118+
- {key: transmission.latency, value: not null}
119+
refs:
120+
- {parentEndpoint: GET:/case/spring-kafka-case, networkAddress: 'kafka-server:9092',
121+
refType: CrossProcess, parentSpanId: not null, parentTraceSegmentId: not null,
122+
parentServiceInstance: not null, parentService: spring-kafka-3.3.x-scenario,
123+
traceId: not null}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
type: jvm
18+
entryService: http://localhost:8080/spring-kafka-3.3.x-scenario/case/spring-kafka-case
19+
healthCheck: http://localhost:8080/spring-kafka-3.3.x-scenario/case/healthCheck
20+
startScript: ./bin/startup.sh
21+
environment:
22+
- BOOTSTRAP_SERVERS=kafka-server:9092
23+
depends_on:
24+
- zookeeper-server
25+
- kafka-server
26+
dependencies:
27+
zookeeper-server:
28+
image: zookeeper:3.4
29+
hostname: zookeeper-server
30+
kafka-server:
31+
image: bitnamilegacy/kafka:2.4.1
32+
hostname: kafka-server
33+
environment:
34+
- KAFKA_ZOOKEEPER_CONNECT=zookeeper-server:2181
35+
- KAFKA_BROKER_ID=1
36+
- ALLOW_PLAINTEXT_LISTENER=yes
37+
- KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9092
38+
depends_on:
39+
- zookeeper-server
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Licensed to the Apache Software Foundation (ASF) under one or more
4+
~ contributor license agreements. See the NOTICE file distributed with
5+
~ this work for additional information regarding copyright ownership.
6+
~ The ASF licenses this file to You under the Apache License, Version 2.0
7+
~ (the "License"); you may not use this file except in compliance with
8+
~ the License. You may obtain a copy of the License at
9+
~
10+
~ http://www.apache.org/licenses/LICENSE-2.0
11+
~
12+
~ Unless required by applicable law or agreed to in writing, software
13+
~ distributed under the License is distributed on an "AS IS" BASIS,
14+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
~ See the License for the specific language governing permissions and
16+
~ limitations under the License.
17+
~
18+
-->
19+
<project xmlns="http://maven.apache.org/POM/4.0.0"
20+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
21+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
22+
<modelVersion>4.0.0</modelVersion>
23+
24+
<groupId>org.apache.skywalking</groupId>
25+
<artifactId>spring-kafka-3.3.x-scenario</artifactId>
26+
<version>5.0.0</version>
27+
28+
<properties>
29+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
30+
<compiler.version>1.8</compiler.version>
31+
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
32+
<test.framework.version>3.3.10</test.framework.version>
33+
<log4j.version>2.6.2</log4j.version>
34+
<spring.boot.version>3.3.10</spring.boot.version>
35+
<kafka-version>3.9.1</kafka-version>
36+
<okhttp-version>3.0.0</okhttp-version>
37+
</properties>
38+
39+
<name>skywalking-spring-kafka-3.3.x-scenario</name>
40+
41+
<dependencies>
42+
<dependency>
43+
<groupId>org.springframework.boot</groupId>
44+
<artifactId>spring-boot-starter-web</artifactId>
45+
<version>${spring.boot.version}</version>
46+
</dependency>
47+
<dependency>
48+
<groupId>org.springframework.kafka</groupId>
49+
<artifactId>spring-kafka</artifactId>
50+
<version>${test.framework.version}</version>
51+
<exclusions>
52+
<exclusion>
53+
<groupId>org.slf4j</groupId>
54+
<artifactId>*</artifactId>
55+
</exclusion>
56+
</exclusions>
57+
</dependency>
58+
<dependency>
59+
<groupId>org.apache.kafka</groupId>
60+
<artifactId>kafka-clients</artifactId>
61+
<version>${kafka-version}</version>
62+
<exclusions>
63+
<exclusion>
64+
<artifactId>slf4j-api</artifactId>
65+
<groupId>*</groupId>
66+
</exclusion>
67+
</exclusions>
68+
</dependency>
69+
<dependency>
70+
<groupId>com.squareup.okhttp3</groupId>
71+
<artifactId>okhttp</artifactId>
72+
<version>${okhttp-version}</version>
73+
</dependency>
74+
</dependencies>
75+
76+
<build>
77+
<finalName>spring-kafka-3.3.x-scenario</finalName>
78+
<plugins>
79+
<plugin>
80+
<groupId>org.springframework.boot</groupId>
81+
<artifactId>spring-boot-maven-plugin</artifactId>
82+
<version>${spring.boot.version}</version>
83+
<executions>
84+
<execution>
85+
<goals>
86+
<goal>repackage</goal>
87+
</goals>
88+
</execution>
89+
</executions>
90+
</plugin>
91+
<plugin>
92+
<artifactId>maven-compiler-plugin</artifactId>
93+
<version>${maven-compiler-plugin.version}</version>
94+
<configuration>
95+
<source>${compiler.version}</source>
96+
<target>${compiler.version}</target>
97+
<encoding>${project.build.sourceEncoding}</encoding>
98+
</configuration>
99+
</plugin>
100+
<plugin>
101+
<groupId>org.apache.maven.plugins</groupId>
102+
<artifactId>maven-assembly-plugin</artifactId>
103+
<executions>
104+
<execution>
105+
<id>assemble</id>
106+
<phase>package</phase>
107+
<goals>
108+
<goal>single</goal>
109+
</goals>
110+
<configuration>
111+
<descriptors>
112+
<descriptor>src/main/assembly/assembly.xml</descriptor>
113+
</descriptors>
114+
<outputDirectory>./target/</outputDirectory>
115+
</configuration>
116+
</execution>
117+
</executions>
118+
</plugin>
119+
</plugins>
120+
</build>
121+
122+
<pluginRepositories>
123+
<pluginRepository>
124+
<id>spring-snapshots</id>
125+
<url>https://repo.spring.io/snapshot</url>
126+
</pluginRepository>
127+
<pluginRepository>
128+
<id>spring-milestones</id>
129+
<url>https://repo.spring.io/milestone</url>
130+
</pluginRepository>
131+
</pluginRepositories>
132+
</project>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Licensed to the Apache Software Foundation (ASF) under one or more
4+
~ contributor license agreements. See the NOTICE file distributed with
5+
~ this work for additional information regarding copyright ownership.
6+
~ The ASF licenses this file to You under the Apache License, Version 2.0
7+
~ (the "License"); you may not use this file except in compliance with
8+
~ the License. You may obtain a copy of the License at
9+
~
10+
~ http://www.apache.org/licenses/LICENSE-2.0
11+
~
12+
~ Unless required by applicable law or agreed to in writing, software
13+
~ distributed under the License is distributed on an "AS IS" BASIS,
14+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
~ See the License for the specific language governing permissions and
16+
~ limitations under the License.
17+
~
18+
-->
19+
<assembly
20+
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
21+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
22+
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
23+
<formats>
24+
<format>zip</format>
25+
</formats>
26+
27+
<fileSets>
28+
<fileSet>
29+
<directory>./bin</directory>
30+
<fileMode>0775</fileMode>
31+
</fileSet>
32+
</fileSets>
33+
34+
<files>
35+
<file>
36+
<source>${project.build.directory}/spring-kafka-3.3.x-scenario.jar</source>
37+
<outputDirectory>./libs</outputDirectory>
38+
<fileMode>0775</fileMode>
39+
</file>
40+
</files>
41+
</assembly>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*
17+
*/
18+
19+
package test.apache.skywalking.apm.testcase.spring.kafka;
20+
21+
import org.springframework.boot.SpringApplication;
22+
import org.springframework.boot.autoconfigure.SpringBootApplication;
23+
24+
@SpringBootApplication
25+
public class Application {
26+
27+
public static void main(String[] args) {
28+
SpringApplication.run(Application.class, args);
29+
}
30+
}

0 commit comments

Comments
 (0)