|
29 | 29 | import com.rabbitmq.client.Channel; |
30 | 30 | import com.rabbitmq.client.Connection; |
31 | 31 | import com.rabbitmq.client.ConnectionFactory; |
32 | | -import com.rabbitmq.client.impl.nio.NioParams; |
33 | 32 | import com.rabbitmq.perf.MulticastParams; |
34 | 33 | import com.rabbitmq.perf.MulticastSet; |
35 | | -import com.rabbitmq.perf.NamedThreadFactory; |
36 | 34 | import com.rabbitmq.perf.PerformanceMetricsAdapter; |
37 | 35 | import com.rabbitmq.perf.metrics.PerformanceMetrics; |
38 | 36 | import java.io.IOException; |
@@ -99,18 +97,17 @@ public Duration interval() { |
99 | 97 | }; |
100 | 98 |
|
101 | 99 | static Stream<Arguments> configurationArguments() { |
102 | | - return Stream.of(blockingIoAndNio(multicastParamsConfigurers())); |
| 100 | + return Stream.of(blockingIoAndNetty(multicastParamsConfigurers())); |
103 | 101 | } |
104 | 102 |
|
105 | | - static Arguments[] blockingIoAndNio(List<Consumer<MulticastParams>> multicastParamsConfigurers) { |
| 103 | + static Arguments[] blockingIoAndNetty( |
| 104 | + List<Consumer<MulticastParams>> multicastParamsConfigurers) { |
106 | 105 | List<Arguments> arguments = new ArrayList<>(); |
107 | 106 | for (Consumer<MulticastParams> configurer : multicastParamsConfigurers) { |
108 | 107 | arguments.add( |
109 | 108 | Arguments.of( |
110 | 109 | configurer, namedConsumer("blocking IO", (Consumer<ConnectionFactory>) cf -> {}))); |
111 | | - arguments.add( |
112 | | - Arguments.of( |
113 | | - configurer, namedConsumer("NIO", (Consumer<ConnectionFactory>) cf -> cf.useNio()))); |
| 110 | + arguments.add(Arguments.of(configurer, namedConsumer("Netty", ConnectionFactory::useNetty))); |
114 | 111 | } |
115 | 112 |
|
116 | 113 | return arguments.toArray(new Arguments[0]); |
@@ -146,7 +143,7 @@ static Stream<Arguments> configurationArgumentsForSeveralUris() { |
146 | 143 | namedConsumer("one server-named queue", empty()), |
147 | 144 | namedConsumer("several queues", severalQueues()), |
148 | 145 | namedConsumer("queue sequence", queueSequence())) |
149 | | - .map(configurer -> Arguments.of(configurer)); |
| 146 | + .map(Arguments::of); |
150 | 147 | } |
151 | 148 |
|
152 | 149 | static Consumer<MulticastParams> empty() { |
@@ -299,23 +296,11 @@ public void shouldRecoverWhenConnectionsAreKilledAndUsingPublishingInterval( |
299 | 296 | } |
300 | 297 |
|
301 | 298 | @Test |
302 | | - public void shouldRecoverWithNio(TestInfo info) throws Exception { |
| 299 | + public void shouldRecoverWithNetty(TestInfo info) throws Exception { |
303 | 300 | params.setQueueNames(Arrays.asList("one", "two", "three")); |
304 | 301 | params.setProducerCount(10); |
305 | 302 | params.setConsumerCount(10); |
306 | | - cf.useNio(); |
307 | | - cf.setNioParams( |
308 | | - new NioParams() |
309 | | - .setNbIoThreads(10) |
310 | | - // see PerfTest#configureNioIfRequested |
311 | | - .setNioExecutor( |
312 | | - new ThreadPoolExecutor( |
313 | | - 10, |
314 | | - params.getProducerCount() + params.getConsumerCount() + 5, |
315 | | - 30L, |
316 | | - TimeUnit.SECONDS, |
317 | | - new SynchronousQueue<>(), |
318 | | - new NamedThreadFactory("perf-test-nio-")))); |
| 303 | + cf.useNetty(); |
319 | 304 | int producerConsumerCount = params.getProducerCount(); |
320 | 305 | MulticastSet set = |
321 | 306 | new MulticastSet(performanceMetrics, cf, params, "", URIS, latchCompletionHandler(1, info)); |
|
0 commit comments