Skip to content

Commit 761be85

Browse files
garyrussellartembilan
authored andcommitted
GH-2522: Upgrade to Rabbit Streams 0.14.0
Fixes #2522 The latest `com.rabbitmq:stream-client` has some convenient fixes for local environment development (including Docker image). Therefore, fix all the Streams test to use just `.port(streamPort())` option for the `Environment` instead of custom `addressResolver`
1 parent 613c289 commit 761be85

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ ext {
6363
micrometerVersion = '1.12.0-RC1'
6464
micrometerTracingVersion = '1.2.0-RC1'
6565
mockitoVersion = '5.5.0'
66-
rabbitmqStreamVersion = '0.12.0'
66+
rabbitmqStreamVersion = '0.14.0'
6767
rabbitmqVersion = project.hasProperty('rabbitmqVersion') ? project.rabbitmqVersion : '5.18.0'
6868
reactorVersion = '2023.0.0-RC1'
6969
snappyVersion = '1.1.8.4'

spring-rabbit-stream/src/test/java/org/springframework/rabbit/stream/listener/RabbitListenerTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
import org.springframework.web.reactive.function.client.WebClient;
6262
import org.springframework.web.util.UriUtils;
6363

64-
import com.rabbitmq.stream.Address;
6564
import com.rabbitmq.stream.Environment;
6665
import com.rabbitmq.stream.Message;
6766
import com.rabbitmq.stream.MessageHandler.Context;
@@ -75,6 +74,7 @@
7574

7675
/**
7776
* @author Gary Russell
77+
* @author Artem Bilan
7878
* @since 2.4
7979
*
8080
*/
@@ -203,7 +203,7 @@ ObservationRegistry obsReg(MeterRegistry meterRegistry) {
203203
@Bean
204204
static Environment environment() {
205205
return Environment.builder()
206-
.addressResolver(add -> new Address("localhost", streamPort()))
206+
.port(streamPort())
207207
.build();
208208
}
209209

@@ -395,6 +395,6 @@ Queue queue() {
395395
.build();
396396
}
397397

398-
}
398+
}
399399

400400
}

spring-rabbit-stream/src/test/java/org/springframework/rabbit/stream/listener/SuperStreamConcurrentSACTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022 the original author or authors.
2+
* Copyright 2022-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -39,12 +39,12 @@
3939
import org.springframework.rabbit.stream.config.SuperStream;
4040
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
4141

42-
import com.rabbitmq.stream.Address;
4342
import com.rabbitmq.stream.Environment;
4443
import com.rabbitmq.stream.OffsetSpecification;
4544

4645
/**
4746
* @author Gary Russell
47+
* @author Artem Bilan
4848
* @since 3.0
4949
*
5050
*/
@@ -105,7 +105,7 @@ SuperStream superStream() {
105105
@Bean
106106
static Environment environment() {
107107
return Environment.builder()
108-
.addressResolver(add -> new Address("localhost", streamPort()))
108+
.port(streamPort())
109109
.maxConsumersByConnection(1)
110110
.build();
111111
}

spring-rabbit-stream/src/test/java/org/springframework/rabbit/stream/listener/SuperStreamSACTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022 the original author or authors.
2+
* Copyright 2022-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -47,12 +47,12 @@
4747
import org.springframework.rabbit.stream.config.SuperStream;
4848
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
4949

50-
import com.rabbitmq.stream.Address;
5150
import com.rabbitmq.stream.Environment;
5251
import com.rabbitmq.stream.OffsetSpecification;
5352

5453
/**
5554
* @author Gary Russell
55+
* @author Artem Bilan
5656
* @since 3.0
5757
*
5858
*/
@@ -122,7 +122,7 @@ SuperStream superStream() {
122122
@Bean
123123
static Environment environment() {
124124
return Environment.builder()
125-
.addressResolver(add -> new Address("localhost", streamPort()))
125+
.port(streamPort())
126126
.build();
127127
}
128128

spring-rabbit-stream/src/test/java/org/springframework/rabbit/stream/micrometer/TracingTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
import org.springframework.rabbit.stream.producer.RabbitStreamTemplate;
3939
import org.springframework.rabbit.stream.support.StreamAdmin;
4040

41-
import com.rabbitmq.stream.Address;
4241
import com.rabbitmq.stream.Environment;
4342
import com.rabbitmq.stream.Message;
4443
import com.rabbitmq.stream.OffsetSpecification;
@@ -51,6 +50,7 @@
5150

5251
/**
5352
* @author Gary Russell
53+
* @author Artem Bilan
5454
* @since 3.0.5
5555
*
5656
*/
@@ -106,7 +106,7 @@ public static class Config {
106106
@Bean
107107
static Environment environment() {
108108
return Environment.builder()
109-
.addressResolver(add -> new Address("localhost", AbstractTestContainerTests.streamPort()))
109+
.port(AbstractTestContainerTests.streamPort())
110110
.build();
111111
}
112112

0 commit comments

Comments
 (0)