Skip to content

Main to 3.1; Upgrade Dependency Versions #2521

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlinVersion = '1.7.0'
ext.kotlinVersion = '1.9.10'
ext.isCI = System.getenv('GITHUB_ACTION') || System.getenv('bamboo_buildKey')
repositories {
mavenCentral()
Expand Down Expand Up @@ -42,7 +42,7 @@ ext {
modifiedFiles =
files(grgit.status().unstaged.modified).filter{ f -> f.name.endsWith('.java') || f.name.endsWith('.kt') }

assertjVersion = '3.23.1'
assertjVersion = '3.24.2'
assertkVersion = '0.24'
awaitilityVersion = '4.2.0'
commonsCompressVersion = '1.20'
Expand All @@ -51,26 +51,26 @@ ext {
googleJsr305Version = '3.0.2'
hamcrestVersion = '2.2'
hibernateValidationVersion = '8.0.0.Final'
jacksonBomVersion = '2.14.2'
jaywayJsonPathVersion = '2.7.0'
jacksonBomVersion = '2.15.2'
jaywayJsonPathVersion = '2.8.0'
junit4Version = '4.13.2'
junitJupiterVersion = '5.9.2'
kotlinCoroutinesVersion = '1.6.4'
log4jVersion = '2.19.0'
logbackVersion = '1.4.4'
junitJupiterVersion = '5.10.0'
kotlinCoroutinesVersion = '1.7.3'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also ext.kotlinVersion = '1.7.0' in the beginning of this file.
It has to go to: 1.9.10

log4jVersion = '2.20.0'
logbackVersion = '1.4.11'
lz4Version = '1.8.0'
micrometerDocsVersion = '1.0.2'
micrometerVersion = '1.10.10'
micrometerTracingVersion = '1.0.9'
mockitoVersion = '4.8.1'
rabbitmqStreamVersion = '0.8.0'
rabbitmqVersion = project.hasProperty('rabbitmqVersion') ? project.rabbitmqVersion : '5.16.1'
reactorVersion = '2022.0.10'
micrometerVersion = '1.12.0-SNAPSHOT'
micrometerTracingVersion = '1.2.0-SNAPSHOT'
mockitoVersion = '5.5.0'
rabbitmqStreamVersion = '0.12.0'
rabbitmqVersion = project.hasProperty('rabbitmqVersion') ? project.rabbitmqVersion : '5.18.0'
reactorVersion = '2023.0.0-SNAPSHOT'
snappyVersion = '1.1.8.4'
springDataVersion = '2022.0.8'
springDataVersion = '2023.1.0-SNAPSHOT'
springRetryVersion = '2.0.2'
springVersion = project.hasProperty('springVersion') ? project.springVersion : '6.0.11'
testcontainersVersion = '1.17.6'
springVersion = project.hasProperty('springVersion') ? project.springVersion : '6.1.0-SNAPSHOT'
testcontainersVersion = '1.19.0'
zstdJniVersion = '1.5.0-2'

javaProjects = subprojects - project(':spring-amqp-bom')
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=3.0.9-SNAPSHOT
version=3.1.0-SNAPSHOT
org.gradle.jvmargs=-Xms512m -Xmx4g -Dfile.encoding=UTF-8
org.gradle.daemon=true
org.gradle.caching=true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2022 the original author or authors.
* Copyright 2016-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 @@ -56,6 +56,7 @@
import org.springframework.amqp.support.postprocessor.GZipPostProcessor;
import org.springframework.amqp.utils.test.TestUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
Expand Down Expand Up @@ -528,12 +529,16 @@ public SimpleMessageListenerContainer replyContainer(ConnectionFactory connectio
}

@Bean
public AsyncRabbitTemplate asyncTemplate(RabbitTemplate template, SimpleMessageListenerContainer container) {
public AsyncRabbitTemplate asyncTemplate(@Qualifier("template") RabbitTemplate template,
SimpleMessageListenerContainer container) {

return new AsyncRabbitTemplate(template, container);
}

@Bean
public AsyncRabbitTemplate asyncDirectTemplate(RabbitTemplate templateForDirect) {
public AsyncRabbitTemplate asyncDirectTemplate(
@Qualifier("templateForDirect") RabbitTemplate templateForDirect) {

return new AsyncRabbitTemplate(templateForDirect);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.ApplicationContext;
Expand Down Expand Up @@ -409,7 +410,7 @@ public void multiListener() {
this.rabbitTemplate.setAfterReceivePostProcessors(mpp);
assertThat(rabbitTemplate.convertSendAndReceive("multi.exch", "multi.rk", qux)).isEqualTo("QUX: qux: multi.rk");
assertThat(beanMethodHeaders).hasSize(2);
assertThat(beanMethodHeaders.get(0)).contains("$MultiListenerBean");
assertThat(beanMethodHeaders.get(0)).contains("MultiListenerBean");
assertThat(beanMethodHeaders.get(1)).isEqualTo("qux");
this.rabbitTemplate.removeAfterReceivePostProcessor(mpp);
assertThat(rabbitTemplate.convertSendAndReceive("multi.exch.tx", "multi.rk.tx", bar)).isEqualTo("BAR: barbar");
Expand Down Expand Up @@ -1203,7 +1204,7 @@ public String multiQueuesConfig(String foo) {
}

@RabbitListener(queues = "test.header", group = "testGroup", replyPostProcessor = "#{'echoPrefixHeader'}")
public String capitalizeWithHeader(@Payload String content, @Header String prefix) {
public String capitalizeWithHeader(@Payload String content, @Header("prefix") String prefix) {
return prefix + content.toUpperCase();
}

Expand All @@ -1213,7 +1214,7 @@ public String capitalizeWithMessage(org.springframework.messaging.Message<String
}

@RabbitListener(queues = "test.reply")
public org.springframework.messaging.Message<?> reply(String payload, @Header String foo,
public org.springframework.messaging.Message<?> reply(String payload, @Header("foo") String foo,
@Header(AmqpHeaders.CONSUMER_TAG) String tag) {
return MessageBuilder.withPayload(payload)
.setHeader("foo", foo).setHeader("bar", tag).build();
Expand Down Expand Up @@ -1677,7 +1678,9 @@ public SimpleRabbitListenerContainerFactory txListenerContainerFactory() {

@Bean
public SimpleMessageListenerContainer factoryCreatedContainerSimpleListener(
@Qualifier("rabbitListenerContainerFactory")
SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory) {

SimpleRabbitListenerEndpoint listener = new SimpleRabbitListenerEndpoint();
listener.setQueueNames("test.manual.container");
listener.setMessageListener((ChannelAwareMessageListener) (message, channel) -> {
Expand All @@ -1689,6 +1692,7 @@ public SimpleMessageListenerContainer factoryCreatedContainerSimpleListener(

@Bean
public SimpleMessageListenerContainer factoryCreatedContainerNoListener(
@Qualifier("rabbitListenerContainerFactory")
SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory) {
SimpleMessageListenerContainer container = rabbitListenerContainerFactory.createListenerContainer();
container.setMessageListener(message -> {
Expand All @@ -1701,7 +1705,7 @@ public SimpleMessageListenerContainer factoryCreatedContainerNoListener(

@Bean
public SimpleRabbitListenerContainerFactory rabbitAutoStartFalseListenerContainerFactory(
ReplyPostProcessor rpp) {
@Qualifier("rpp") ReplyPostProcessor rpp) {

SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
factory.setConnectionFactory(rabbitConnectionFactory());
Expand Down Expand Up @@ -2466,14 +2470,14 @@ public String messagingMessage(org.springframework.messaging.Message<?> message)

@RabbitListener(queues = "test.converted.foomessage")
public String messagingMessage(org.springframework.messaging.Message<Foo2> message,
@Header(value = "", required = false) String h,
@Header(value = "notPresent", required = false) String h,
@Header(name = AmqpHeaders.RECEIVED_USER_ID) String userId) {
return message.getClass().getSimpleName() + message.getPayload().getClass().getSimpleName() + userId;
}

@RabbitListener(queues = "test.notconverted.messagingmessagenotgeneric")
public String messagingMessage(@SuppressWarnings("rawtypes") org.springframework.messaging.Message message,
@Header(value = "", required = false) Integer h) {
@Header(value = "notPresent", required = false) Integer h) {
return message.getClass().getSimpleName() + message.getPayload().getClass().getSimpleName();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2019 the original author or authors.
* Copyright 2014-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 @@ -465,7 +465,7 @@ public void resolveGenericMessage(Message<String> message) {
assertThat(message.getPayload()).as("Wrong message payload").isEqualTo("test");
}

public void resolveHeaderAndPayload(@Payload String content, @Header int myCounter,
public void resolveHeaderAndPayload(@Payload String content, @Header("myCounter") int myCounter,
@Header(AmqpHeaders.CONSUMER_TAG) String tag,
@Header(AmqpHeaders.CONSUMER_QUEUE) String queue) {
invocations.put("resolveHeaderAndPayload", true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<bean id="simpleFactory" class="org.springframework.amqp.rabbit.config.RabbitListenerContainerTestFactory"/>

<bean id="rabbitAdmin" class="org.mockito.Mockito" factory-method="mock">
<constructor-arg value="org.springframework.amqp.rabbit.core.RabbitAdmin"/>
<constructor-arg value="org.springframework.amqp.rabbit.core.RabbitAdmin" type="java.lang.Class"/>
</bean>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<bean id="simpleFactory" class="org.springframework.amqp.rabbit.config.RabbitListenerContainerTestFactory"/>

<bean id="rabbitAdmin" class="org.mockito.Mockito" factory-method="mock">
<constructor-arg value="org.springframework.amqp.rabbit.core.RabbitAdmin"/>
<constructor-arg value="org.springframework.amqp.rabbit.core.RabbitAdmin" type="java.lang.Class"/>
</bean>

<context:property-placeholder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<rabbit:queue id="foo" ignore-declaration-exceptions="true" declared-by="myAdmin" auto-declare="false"/>

<bean id="mockFactory" class="org.mockito.Mockito" factory-method="mock">
<constructor-arg value="org.springframework.amqp.rabbit.connection.ConnectionFactory"/>
<constructor-arg value="org.springframework.amqp.rabbit.connection.ConnectionFactory" type="java.lang.Class"/>
</bean>

<rabbit:admin id="myAdmin" connection-factory="mockFactory"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
connection-name-strategy="connectionNameStrategy"/>

<bean id="connectionNameStrategy" class="org.mockito.Mockito" factory-method="mock">
<constructor-arg value="org.springframework.amqp.rabbit.connection.ConnectionNameStrategy"/>
<constructor-arg value="org.springframework.amqp.rabbit.connection.ConnectionNameStrategy"
type="java.lang.Class"/>
</bean>

<rabbit:connection-factory id="native" connection-factory="connectionFactory" channel-cache-size="10" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
<rabbit:admin id="admin2" auto-startup="false" connection-factory="mockCF" />

<bean id="mockCF" class="org.mockito.Mockito" factory-method="mock">
<constructor-arg value="org.springframework.amqp.rabbit.connection.ConnectionFactory" />
<constructor-arg value="org.springframework.amqp.rabbit.connection.ConnectionFactory"
type="java.lang.Class"/>
</bean>

</beans>
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@
<rabbit:queue id="noAutoDeclare" auto-declare="false" />

<beans:bean id="mockCF" class="org.mockito.Mockito" factory-method="mock">
<beans:constructor-arg value="org.springframework.amqp.rabbit.connection.ConnectionFactory" />
<beans:constructor-arg value="org.springframework.amqp.rabbit.connection.ConnectionFactory"
type="java.lang.Class" />
</beans:bean>

</beans>
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@
<rabbit:queue id="noAutoDeclare" auto-declare="false" />

<beans:bean id="mockCF" class="org.mockito.Mockito" factory-method="mock">
<beans:constructor-arg value="org.springframework.amqp.rabbit.connection.ConnectionFactory" />
<beans:constructor-arg value="org.springframework.amqp.rabbit.connection.ConnectionFactory"
type="java.lang.Class"/>
</beans:bean>

</beans>
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,19 @@
receive-connection-factory-selector-expression="'foo'"/>

<bean id="rcb" class="org.mockito.Mockito" factory-method="mock">
<constructor-arg value="org.springframework.amqp.rabbit.core.RabbitTemplate$ReturnsCallback"/>
<constructor-arg value="org.springframework.amqp.rabbit.core.RabbitTemplate$ReturnsCallback"
type="java.lang.Class"/>
</bean>

<bean id="ccb" class="org.mockito.Mockito" factory-method="mock">
<constructor-arg value="org.springframework.amqp.rabbit.core.RabbitTemplate$ConfirmCallback"/>
<constructor-arg value="org.springframework.amqp.rabbit.core.RabbitTemplate$ConfirmCallback"
type="java.lang.Class"/>
</bean>

<bean id="retrier" class="org.springframework.retry.support.RetryTemplate"/>

<bean id="recoverer" class="org.mockito.Mockito" factory-method="mock">
<constructor-arg value="org.springframework.retry.RecoveryCallback"/>
<constructor-arg value="org.springframework.retry.RecoveryCallback" type="java.lang.Class"/>
</bean>

</beans>