Skip to content

Commit 8559989

Browse files
glcrazierlizhanhui
andauthored
Support RocketMQ5 benchmark using grpc sdk (#444)
* Support RocketMQ5 benchmark using grpc sdk * chore: update README Signed-off-by: Li Zhanhui <lizhanhui@gmail.com> --------- Signed-off-by: Li Zhanhui <lizhanhui@gmail.com> Co-authored-by: Li Zhanhui <lizhanhui@gmail.com>
1 parent 0961d8b commit 8559989

9 files changed

Lines changed: 537 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ This repository houses user-friendly, cloud-ready benchmarking suites for the fo
2323
* [Pravega](https://pravega.io/)
2424
* [RabbitMQ](https://www.rabbitmq.com/)
2525
* [Redis](https://redis.com/)
26+
* [MQTT](https://mqtt.org/)
2627

2728
> More details could be found at the [official documentation](http://openmessaging.cloud/docs/benchmarks/).
2829

benchmark-framework/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@
106106
<artifactId>driver-rocketmq</artifactId>
107107
<version>${project.version}</version>
108108
</dependency>
109+
<dependency>
110+
<groupId>${project.groupId}</groupId>
111+
<artifactId>driver-rocketmq5</artifactId>
112+
<version>${project.version}</version>
113+
</dependency>
109114
<dependency>
110115
<groupId>com.beust</groupId>
111116
<artifactId>jcommander</artifactId>

driver-rocketmq5/pom.xml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
16+
-->
17+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
19+
<modelVersion>4.0.0</modelVersion>
20+
<parent>
21+
<groupId>io.openmessaging.benchmark</groupId>
22+
<artifactId>messaging-benchmark</artifactId>
23+
<version>0.0.1-SNAPSHOT</version>
24+
</parent>
25+
26+
<artifactId>driver-rocketmq5</artifactId>
27+
28+
<properties>
29+
<rocketmq-client-java-version>5.0.7</rocketmq-client-java-version>
30+
<rocketmq.version>5.1.0</rocketmq.version>
31+
<guava.version>29.0-jre</guava.version>
32+
</properties>
33+
34+
<dependencies>
35+
<dependency>
36+
<groupId>${project.groupId}</groupId>
37+
<artifactId>driver-api</artifactId>
38+
<version>${project.version}</version>
39+
</dependency>
40+
<dependency>
41+
<groupId>com.google.guava</groupId>
42+
<artifactId>guava</artifactId>
43+
<version>${guava.version}</version>
44+
</dependency>
45+
46+
<dependency>
47+
<groupId>org.apache.rocketmq</groupId>
48+
<artifactId>rocketmq-client-java</artifactId>
49+
<version>${rocketmq-client-java-version}</version>
50+
</dependency>
51+
<dependency>
52+
<groupId>org.apache.rocketmq</groupId>
53+
<artifactId>rocketmq-tools</artifactId>
54+
<version>${rocketmq.version}</version>
55+
<exclusions>
56+
<exclusion>
57+
<groupId>ch.qos.logback</groupId>
58+
<artifactId>logback-classic</artifactId>
59+
</exclusion>
60+
</exclusions>
61+
</dependency>
62+
</dependencies>
63+
64+
</project>

driver-rocketmq5/rocketmq.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
#
14+
15+
name: RocketMQ5
16+
driverClass: io.openmessaging.benchmark.driver.rocketmq.RocketMQ5BenchmarkDriver
17+
18+
# The RocketMQ nameserver address
19+
namesrvAddr: x.x.x.x:9876
20+
# The RocketMQ broker cluster name
21+
clusterName: rocketmq-broker-xxxx
22+
# The proxy address to connect for grpc client.
23+
grpcEndpoint: 127.0.0.1:8081
24+
# 是否生产定时消息,否:生产普通消息,是:生产定时/延时消息且通过delayTimeInSec设置延迟时间
25+
sendDelayMsg: false
26+
delayTimeInSec: 60
27+
# (Optional) The admin credential
28+
adminAccessKey: xxxx
29+
adminSecretKey: xxxx
30+
# (Optional) The credential that clients connect to proxy.
31+
accessKey: xxxxxx
32+
secretKey: xxxxx
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Licensed under the Apache License, Version 2.0 (the "License");
3+
* you may not use this file except in compliance with the License.
4+
* You may obtain a copy of the License at
5+
*
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
*
8+
* Unless required by applicable law or agreed to in writing, software
9+
* distributed under the License is distributed on an "AS IS" BASIS,
10+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
* See the License for the specific language governing permissions and
12+
* limitations under the License.
13+
*/
14+
package io.openmessaging.benchmark.driver.rocketmq;
15+
16+
17+
import io.openmessaging.benchmark.driver.BenchmarkConsumer;
18+
import org.apache.rocketmq.client.apis.consumer.PushConsumer;
19+
20+
public class RocketMQ5BenchmarkConsumer implements BenchmarkConsumer {
21+
private final PushConsumer rmqConsumer;
22+
23+
public RocketMQ5BenchmarkConsumer(final PushConsumer rmqConsumer) {
24+
this.rmqConsumer = rmqConsumer;
25+
}
26+
27+
@Override
28+
public void close() throws Exception {
29+
this.rmqConsumer.close();
30+
}
31+
}

0 commit comments

Comments
 (0)