Skip to content

Commit 64bd123

Browse files
authored
Start building against Spring Framework 7.0.0 snapshots
See spring-projects/spring-framework#35772 Signed-off-by: Stéphane Nicoll <[email protected]>
1 parent b77c5d9 commit 64bd123

File tree

12 files changed

+26
-26
lines changed

12 files changed

+26
-26
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ ext {
5656
rabbitmqVersion = '5.27.1'
5757
reactorVersion = '2025.0.1-SNAPSHOT'
5858
springDataVersion = '2025.1.0-SNAPSHOT'
59-
springVersion = '7.0.0-RC1'
59+
springVersion = '7.0.0-SNAPSHOT'
6060
testcontainersVersion = '2.0.1'
6161

6262
javaProjects = subprojects - project(':spring-amqp-bom')

spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/RetryInterceptorBuilder.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
* <pre class="code">
4141
* StatefulRetryOperationsInterceptor interceptor =
4242
* RetryInterceptorBuilder.stateful()
43-
* .maxAttempts(5)
43+
* .maxRetries(5)
4444
* .backOffOptions(1, 2, 10) // initialInterval, multiplier, maxInterval
4545
* .build();
4646
* </pre>
@@ -127,13 +127,13 @@ public B configureRetryPolicy(Consumer<RetryPolicy.Builder> retryPolicy) {
127127
}
128128

129129
/**
130-
* Apply the max attempts - a SimpleRetryPolicy will be used. Cannot be used if a custom retry operations
130+
* Apply the max retries - a SimpleRetryPolicy will be used. Cannot be used if a custom retry operations
131131
* or retry policy has been set.
132-
* @param maxAttempts the max attempts.
132+
* @param maxRetries the maximum number of retry attempts..
133133
* @return this.
134134
*/
135-
public B maxAttempts(int maxAttempts) {
136-
return configureRetryPolicy((retryPolicy) -> retryPolicy.maxAttempts(maxAttempts));
135+
public B maxRetries(int maxRetries) {
136+
return configureRetryPolicy((retryPolicy) -> retryPolicy.maxRetries(maxRetries));
137137
}
138138

139139
/**

spring-rabbit/src/main/java/org/springframework/amqp/rabbit/core/RabbitAdmin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public class RabbitAdmin implements AmqpAdmin, ApplicationContextAware, Applicat
9090

9191
private static final String UNUSED = "unused";
9292

93-
private static final int DECLARE_MAX_ATTEMPTS = 5;
93+
private static final int DECLARE_MAX_RETRIES = 5;
9494

9595
private static final Duration DECLARE_INITIAL_RETRY_DELAY = Duration.ofSeconds(1);
9696

@@ -597,7 +597,7 @@ public void afterPropertiesSet() {
597597
if (this.retryTemplate == null && !this.retryDisabled) {
598598
RetryPolicy retryPolicy =
599599
RetryPolicy.builder()
600-
.maxAttempts(DECLARE_MAX_ATTEMPTS)
600+
.maxRetries(DECLARE_MAX_RETRIES)
601601
.delay(DECLARE_INITIAL_RETRY_DELAY)
602602
.multiplier(DECLARE_RETRY_MULTIPLIER)
603603
.maxDelay(DECLARE_MAX_RETRY_DELAY)

spring-rabbit/src/main/java/org/springframework/amqp/rabbit/log4j2/AmqpAppender.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ private void startSenders() {
181181
}
182182
}
183183
else if (this.manager.maxSenderRetries > 0) {
184-
this.rabbitTemplate.setRetryTemplate(new RetryTemplate(RetryPolicy.withMaxAttempts(2)));
184+
this.rabbitTemplate.setRetryTemplate(new RetryTemplate(RetryPolicy.withMaxRetries(2)));
185185
}
186186
}
187187

spring-rabbit/src/test/java/org/springframework/amqp/rabbit/config/RetryInterceptorBuilderSupportTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public void testBasic() {
6565

6666
@Test
6767
public void testWithCustomRetryPolicy() {
68-
RetryPolicy retryPolicy = RetryPolicy.builder().maxAttempts(2).build();
68+
RetryPolicy retryPolicy = RetryPolicy.builder().maxRetries(2).build();
6969
StatefulRetryOperationsInterceptor interceptor = RetryInterceptorBuilder.stateful()
7070
.retryPolicy(retryPolicy)
7171
.build();
@@ -78,7 +78,7 @@ public void testWithCustomRetryPolicy() {
7878
public void testWithMoreAttempts() {
7979
StatefulRetryOperationsInterceptor interceptor =
8080
RetryInterceptorBuilder.stateful()
81-
.maxAttempts(5)
81+
.maxRetries(5)
8282
.build();
8383

8484
assertThat(TestUtils.getPropertyValue(interceptor, "retryPolicy.backOff.maxAttempts")).isEqualTo(5L);
@@ -88,7 +88,7 @@ public void testWithMoreAttempts() {
8888
public void testWithCustomizedBackOffMoreAttempts() {
8989
StatefulRetryOperationsInterceptor interceptor =
9090
RetryInterceptorBuilder.stateful()
91-
.maxAttempts(5)
91+
.maxRetries(5)
9292
.backOffOptions(1, 2, 10)
9393
.build();
9494

@@ -149,7 +149,7 @@ public void testWithCustomNewMessageIdentifier() throws Exception {
149149
@Test
150150
public void testWitCustomRetryPolicyTraverseCause() {
151151
StatefulRetryOperationsInterceptor interceptor = RetryInterceptorBuilder.stateful()
152-
.retryPolicy(RetryPolicy.builder().maxAttempts(15).build())
152+
.retryPolicy(RetryPolicy.builder().maxRetries(15).build())
153153
.build();
154154

155155
assertThat(TestUtils.getPropertyValue(interceptor, "retryPolicy.backOff.maxAttempts")).isEqualTo(15L);

spring-rabbit/src/test/java/org/springframework/amqp/rabbit/config/StatelessRetryOperationsInterceptorTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void invokeWithSuccessOnFirstInvocation() throws Throwable {
5555

5656
@Test
5757
void invokeWithFailuresNotExhaustingRetries() throws Throwable {
58-
RetryPolicy retryPolicy = RetryPolicy.builder().maxAttempts(2).delay(Duration.ZERO).build();
58+
RetryPolicy retryPolicy = RetryPolicy.builder().maxRetries(2).delay(Duration.ZERO).build();
5959
MethodInvocation invocation = mock(MethodInvocation.class);
6060
given(invocation.proceed()).willThrow(new IllegalStateException("initial"))
6161
.willThrow(new IllegalStateException("retry-1")).willReturn("hello");
@@ -66,7 +66,7 @@ void invokeWithFailuresNotExhaustingRetries() throws Throwable {
6666

6767
@Test
6868
void invokeWithFailuresExhaustingRetriesReturnsResultFromRecoverer() throws Throwable {
69-
RetryPolicy retryPolicy = RetryPolicy.builder().maxAttempts(2).delay(Duration.ZERO).build();
69+
RetryPolicy retryPolicy = RetryPolicy.builder().maxRetries(2).delay(Duration.ZERO).build();
7070
Exception lastException = new IllegalStateException("retry-2");
7171
Object[] arguments = new Object[] { "message" };
7272
MethodInvocation invocation = mock(MethodInvocation.class);
@@ -82,7 +82,7 @@ void invokeWithFailuresExhaustingRetriesReturnsResultFromRecoverer() throws Thro
8282

8383
@Test
8484
void invokeWithFailuresExhaustingRetriesThrowsResultFromRecoverer() throws Throwable {
85-
RetryPolicy retryPolicy = RetryPolicy.builder().maxAttempts(2).delay(Duration.ZERO).build();
85+
RetryPolicy retryPolicy = RetryPolicy.builder().maxRetries(2).delay(Duration.ZERO).build();
8686
Exception recovererException = new IllegalStateException("failed");
8787
Object[] arguments = new Object[] { "message" };
8888
MethodInvocation invocation = mock(MethodInvocation.class);
@@ -97,7 +97,7 @@ void invokeWithFailuresExhaustingRetriesThrowsResultFromRecoverer() throws Throw
9797

9898
@Test
9999
void invokeWithFailuresExhaustingRetriesAndNoRecovererThrowsLastException() throws Throwable {
100-
RetryPolicy retryPolicy = RetryPolicy.builder().maxAttempts(2).delay(Duration.ZERO).build();
100+
RetryPolicy retryPolicy = RetryPolicy.builder().maxRetries(2).delay(Duration.ZERO).build();
101101
Exception LastException = new IllegalStateException("retry-2");
102102
Object[] arguments = new Object[] { "message" };
103103
MethodInvocation invocation = mock(MethodInvocation.class);

spring-rabbit/src/test/java/org/springframework/amqp/rabbit/core/RabbitAdminTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ public void testRetry() throws Exception {
340340
CachingConnectionFactory ccf = new CachingConnectionFactory(rabbitConnectionFactory);
341341
RabbitAdmin admin = new RabbitAdmin(ccf);
342342
RetryTemplate rtt = new RetryTemplate();
343-
rtt.setRetryPolicy(RetryPolicy.builder().maxAttempts(2).delay(Duration.ZERO).build());
343+
rtt.setRetryPolicy(RetryPolicy.builder().maxRetries(2).delay(Duration.ZERO).build());
344344
admin.setRetryTemplate(rtt);
345345
GenericApplicationContext ctx = new GenericApplicationContext();
346346
ctx.getBeanFactory().registerSingleton("foo", new AnonymousQueue());

spring-rabbit/src/test/java/org/springframework/amqp/rabbit/core/RabbitTemplateTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ public void testRetry() throws Exception {
209209
SingleConnectionFactory connectionFactory = new SingleConnectionFactory(mockConnectionFactory);
210210
connectionFactory.setExecutor(mock(ExecutorService.class));
211211
RabbitTemplate template = new RabbitTemplate(connectionFactory);
212-
template.setRetryTemplate(new RetryTemplate(RetryPolicy.builder().maxAttempts(3).delay(Duration.ZERO).build()));
212+
template.setRetryTemplate(new RetryTemplate(RetryPolicy.builder().maxRetries(3).delay(Duration.ZERO).build()));
213213
try {
214214
template.convertAndSend("foo", "bar", "baz");
215215
}
@@ -295,7 +295,7 @@ public void testRecovery() throws Exception {
295295
SingleConnectionFactory connectionFactory = new SingleConnectionFactory(mockConnectionFactory);
296296
connectionFactory.setExecutor(mock(ExecutorService.class));
297297
RabbitTemplate template = new RabbitTemplate(connectionFactory);
298-
template.setRetryTemplate(new RetryTemplate(RetryPolicy.builder().maxAttempts(3).delay(Duration.ZERO).build()));
298+
template.setRetryTemplate(new RetryTemplate(RetryPolicy.builder().maxRetries(3).delay(Duration.ZERO).build()));
299299

300300
final AtomicBoolean recoverInvoked = new AtomicBoolean();
301301

spring-rabbit/src/test/java/org/springframework/amqp/rabbit/listener/MessageListenerContainerRetryIntegrationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ private Advice createRetryInterceptor(final CountDownLatch latch, boolean statef
210210
latch.countDown();
211211
});
212212
}
213-
factory.setRetryPolicy(RetryPolicy.builder().maxAttempts(2).delay(Duration.ofMillis(100)).build());
213+
factory.setRetryPolicy(RetryPolicy.builder().maxRetries(2).delay(Duration.ofMillis(100)).build());
214214
return factory.getObject();
215215
}
216216

spring-rabbit/src/test/java/org/springframework/amqp/rabbit/listener/adapter/MessageListenerAdapterTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public void testReplyRetry() throws Exception {
203203
this.adapter = new MessageListenerAdapter();
204204
this.adapter.setDefaultListenerMethod("handle");
205205
this.adapter.setDelegate(this.simpleService);
206-
RetryPolicy retryPolicy = RetryPolicy.builder().maxAttempts(2).delay(Duration.ZERO).build();
206+
RetryPolicy retryPolicy = RetryPolicy.builder().maxRetries(2).delay(Duration.ZERO).build();
207207
RetryTemplate retryTemplate = new RetryTemplate();
208208
retryTemplate.setRetryPolicy(retryPolicy);
209209
this.adapter.setRetryTemplate(retryTemplate);

0 commit comments

Comments
 (0)