Skip to content

Commit d33d297

Browse files
authored
Merge pull request #66 from rabbitmq/rabbitmq-perf-test-64
Spreads producers and consumers across multiple queues based on a queue pattern
2 parents e979ff1 + 6b59258 commit d33d297

File tree

10 files changed

+1163
-108
lines changed

10 files changed

+1163
-108
lines changed

pom.xml

Lines changed: 66 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@
5959
<metrics.version>3.2.5</metrics.version>
6060
<logback.version>1.2.3</logback.version>
6161
<jetty.version>9.4.7.v20170914</jetty.version>
62-
<junit.version>4.12</junit.version>
62+
<junit.jupiter.version>5.0.2</junit.jupiter.version>
63+
<junit.platform.version>1.0.2</junit.platform.version>
64+
<mockito.version>2.13.0</mockito.version>
65+
<hamcrest.version>2.0.0.0</hamcrest.version>
6366

6467
<!-- to sign artifacts when releasing -->
6568
<gpg.keyname>6026DFCA</gpg.keyname>
@@ -75,6 +78,7 @@
7578
<checksum.maven.plugin.version>1.6</checksum.maven.plugin.version>
7679
<maven.jar.plugin.version>3.0.2</maven.jar.plugin.version>
7780
<buildnumber.plugin.version>1.4</buildnumber.plugin.version>
81+
<maven.surefire.plugin.version>2.19.1</maven.surefire.plugin.version>
7882

7983
<!-- because of https://issues.apache.org/jira/browse/MRESOURCES-99 -->
8084
<build.timestamp>${maven.build.timestamp}</build.timestamp>
@@ -104,11 +108,56 @@
104108
</dependency>
105109

106110
<dependency>
107-
<groupId>junit</groupId>
108-
<artifactId>junit</artifactId>
109-
<version>${junit.version}</version>
111+
<groupId>org.junit.jupiter</groupId>
112+
<artifactId>junit-jupiter-engine</artifactId>
113+
<version>${junit.jupiter.version}</version>
110114
<scope>test</scope>
111115
</dependency>
116+
<!-- To avoid compiler warnings about @API annotations in JUnit code -->
117+
<dependency>
118+
<groupId>org.apiguardian</groupId>
119+
<artifactId>apiguardian-api</artifactId>
120+
<version>1.0.0</version>
121+
<scope>test</scope>
122+
</dependency>
123+
124+
<!-- to support JUnit 4 rules -->
125+
<dependency>
126+
<groupId>org.junit.jupiter</groupId>
127+
<artifactId>junit-jupiter-migrationsupport</artifactId>
128+
<version>${junit.jupiter.version}</version>
129+
<scope>test</scope>
130+
</dependency>
131+
132+
<!-- for parameterized tests -->
133+
<dependency>
134+
<groupId>org.junit.jupiter</groupId>
135+
<artifactId>junit-jupiter-params</artifactId>
136+
<version>${junit.jupiter.version}</version>
137+
<scope>test</scope>
138+
</dependency>
139+
140+
<dependency>
141+
<groupId>org.mockito</groupId>
142+
<artifactId>mockito-core</artifactId>
143+
<version>${mockito.version}</version>
144+
<scope>test</scope>
145+
</dependency>
146+
147+
<dependency>
148+
<groupId>org.hamcrest</groupId>
149+
<artifactId>hamcrest-junit</artifactId>
150+
<version>${hamcrest.version}</version>
151+
<scope>test</scope>
152+
</dependency>
153+
154+
<dependency>
155+
<groupId>ch.qos.logback</groupId>
156+
<artifactId>logback-classic</artifactId>
157+
<version>${logback.version}</version>
158+
<scope>test</scope>
159+
</dependency>
160+
112161
</dependencies>
113162

114163
<build>
@@ -145,6 +194,19 @@
145194
</configuration>
146195
</plugin>
147196

197+
<plugin>
198+
<groupId>org.apache.maven.plugins</groupId>
199+
<artifactId>maven-surefire-plugin</artifactId>
200+
<version>${maven.surefire.plugin.version}</version>
201+
<dependencies>
202+
<dependency>
203+
<groupId>org.junit.platform</groupId>
204+
<artifactId>junit-platform-surefire-provider</artifactId>
205+
<version>${junit.platform.version}</version>
206+
</dependency>
207+
</dependencies>
208+
</plugin>
209+
148210
<plugin>
149211
<groupId>org.codehaus.mojo</groupId>
150212
<artifactId>versions-maven-plugin</artifactId>

src/main/java/com/rabbitmq/perf/Consumer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import com.rabbitmq.client.DefaultConsumer;
2121
import com.rabbitmq.client.Envelope;
2222
import com.rabbitmq.client.ShutdownSignalException;
23+
import org.slf4j.LoggerFactory;
2324

2425
import java.io.ByteArrayInputStream;
2526
import java.io.DataInputStream;
@@ -112,7 +113,7 @@ public void run() {
112113
} catch (IOException e) {
113114
throw new RuntimeException(e);
114115
} catch (InterruptedException e) {
115-
throw new RuntimeException(e);
116+
LoggerFactory.getLogger(getClass()).warn("Consumer thread has been interrupted");
116117
} catch (ShutdownSignalException e) {
117118
throw new RuntimeException(e);
118119
}

0 commit comments

Comments
 (0)