Skip to content

Commit

Permalink
GH-2522: Upgrade to Rabbit Streams 0.14.0
Browse files Browse the repository at this point in the history
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`
  • Loading branch information
garyrussell authored and artembilan committed Nov 6, 2023
1 parent 613c289 commit 761be85
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ ext {
micrometerVersion = '1.12.0-RC1'
micrometerTracingVersion = '1.2.0-RC1'
mockitoVersion = '5.5.0'
rabbitmqStreamVersion = '0.12.0'
rabbitmqStreamVersion = '0.14.0'
rabbitmqVersion = project.hasProperty('rabbitmqVersion') ? project.rabbitmqVersion : '5.18.0'
reactorVersion = '2023.0.0-RC1'
snappyVersion = '1.1.8.4'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
import org.springframework.web.reactive.function.client.WebClient;
import org.springframework.web.util.UriUtils;

import com.rabbitmq.stream.Address;
import com.rabbitmq.stream.Environment;
import com.rabbitmq.stream.Message;
import com.rabbitmq.stream.MessageHandler.Context;
Expand All @@ -75,6 +74,7 @@

/**
* @author Gary Russell
* @author Artem Bilan
* @since 2.4
*
*/
Expand Down Expand Up @@ -203,7 +203,7 @@ ObservationRegistry obsReg(MeterRegistry meterRegistry) {
@Bean
static Environment environment() {
return Environment.builder()
.addressResolver(add -> new Address("localhost", streamPort()))
.port(streamPort())
.build();
}

Expand Down Expand Up @@ -395,6 +395,6 @@ Queue queue() {
.build();
}

}
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 the original author or authors.
* Copyright 2022-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -39,12 +39,12 @@
import org.springframework.rabbit.stream.config.SuperStream;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;

import com.rabbitmq.stream.Address;
import com.rabbitmq.stream.Environment;
import com.rabbitmq.stream.OffsetSpecification;

/**
* @author Gary Russell
* @author Artem Bilan
* @since 3.0
*
*/
Expand Down Expand Up @@ -105,7 +105,7 @@ SuperStream superStream() {
@Bean
static Environment environment() {
return Environment.builder()
.addressResolver(add -> new Address("localhost", streamPort()))
.port(streamPort())
.maxConsumersByConnection(1)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 the original author or authors.
* Copyright 2022-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -47,12 +47,12 @@
import org.springframework.rabbit.stream.config.SuperStream;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;

import com.rabbitmq.stream.Address;
import com.rabbitmq.stream.Environment;
import com.rabbitmq.stream.OffsetSpecification;

/**
* @author Gary Russell
* @author Artem Bilan
* @since 3.0
*
*/
Expand Down Expand Up @@ -122,7 +122,7 @@ SuperStream superStream() {
@Bean
static Environment environment() {
return Environment.builder()
.addressResolver(add -> new Address("localhost", streamPort()))
.port(streamPort())
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import org.springframework.rabbit.stream.producer.RabbitStreamTemplate;
import org.springframework.rabbit.stream.support.StreamAdmin;

import com.rabbitmq.stream.Address;
import com.rabbitmq.stream.Environment;
import com.rabbitmq.stream.Message;
import com.rabbitmq.stream.OffsetSpecification;
Expand All @@ -51,6 +50,7 @@

/**
* @author Gary Russell
* @author Artem Bilan
* @since 3.0.5
*
*/
Expand Down Expand Up @@ -106,7 +106,7 @@ public static class Config {
@Bean
static Environment environment() {
return Environment.builder()
.addressResolver(add -> new Address("localhost", AbstractTestContainerTests.streamPort()))
.port(AbstractTestContainerTests.streamPort())
.build();
}

Expand Down

0 comments on commit 761be85

Please sign in to comment.