Skip to content

Commit 66ca074

Browse files
committed
Fix deprecation for RetryListenerSupport
Related to spring-projects/spring-retry#326
1 parent 4206c41 commit 66ca074

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

spring-integration-kafka/src/test/java/org/springframework/integration/kafka/inbound/InboundGatewayTests.java

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
import org.springframework.messaging.support.ErrorMessage;
5757
import org.springframework.retry.RetryCallback;
5858
import org.springframework.retry.RetryContext;
59+
import org.springframework.retry.RetryListener;
5960
import org.springframework.retry.backoff.NoBackOffPolicy;
60-
import org.springframework.retry.listener.RetryListenerSupport;
6161
import org.springframework.retry.policy.SimpleRetryPolicy;
6262
import org.springframework.retry.support.RetryTemplate;
6363

@@ -379,14 +379,10 @@ void testInboundRetryErrorRecoverWithoutRecoveryCallback(EmbeddedKafkaBroker emb
379379
KafkaTemplate<Integer, String> template = new KafkaTemplate<>(pf);
380380
template.setDefaultTopic(topic7);
381381
KafkaInboundGateway<Integer, String, String> gateway = new KafkaInboundGateway<>(container, template);
382-
MessageChannel out = new DirectChannel() {
383-
384-
@Override
385-
protected boolean doSend(Message<?> message, long timeout) {
386-
throw new RuntimeException("intended");
387-
}
388-
389-
};
382+
MessageChannel out =
383+
(message, timeout) -> {
384+
throw new RuntimeException("intended");
385+
};
390386
gateway.setRequestChannel(out);
391387
gateway.setBeanFactory(mock(BeanFactory.class));
392388
gateway.setReplyTimeout(30_000);
@@ -396,11 +392,12 @@ protected boolean doSend(Message<?> message, long timeout) {
396392
retryTemplate.setRetryPolicy(retryPolicy);
397393
retryTemplate.setBackOffPolicy(new NoBackOffPolicy());
398394
final CountDownLatch retryCountLatch = new CountDownLatch(retryPolicy.getMaxAttempts());
399-
retryTemplate.registerListener(new RetryListenerSupport() {
395+
retryTemplate.registerListener(new RetryListener() {
400396

401397
@Override
402398
public <T, E extends Throwable> void onError(RetryContext context, RetryCallback<T, E> callback,
403399
Throwable throwable) {
400+
404401
retryCountLatch.countDown();
405402
}
406403
});

spring-integration-kafka/src/test/java/org/springframework/integration/kafka/inbound/MessageDrivenAdapterTests.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
import org.springframework.messaging.support.ErrorMessage;
8484
import org.springframework.retry.RetryCallback;
8585
import org.springframework.retry.RetryContext;
86-
import org.springframework.retry.listener.RetryListenerSupport;
86+
import org.springframework.retry.RetryListener;
8787
import org.springframework.retry.policy.SimpleRetryPolicy;
8888
import org.springframework.retry.support.RetryTemplate;
8989

@@ -310,11 +310,12 @@ protected boolean doSend(Message<?> message, long timeout) {
310310
retryPolicy.setMaxAttempts(2);
311311
retryTemplate.setRetryPolicy(retryPolicy);
312312
final CountDownLatch retryCountLatch = new CountDownLatch(retryPolicy.getMaxAttempts());
313-
retryTemplate.registerListener(new RetryListenerSupport() {
313+
retryTemplate.registerListener(new RetryListener() {
314314

315315
@Override
316316
public <T, E extends Throwable> void onError(RetryContext context, RetryCallback<T, E> callback,
317317
Throwable throwable) {
318+
318319
retryCountLatch.countDown();
319320
}
320321
});

0 commit comments

Comments
 (0)