default UnaryOperator<SimpleMessageListenerContainer> setRetryOpertations(Optional<Integer> maxAttempts, Optional<BackoffOptions> backoffOptions) { StatelessRetryInterceptorBuilder builder = RetryInterceptorBuilder.stateless(); if (maxAttempts.isPresent()) { builder.maxAttempts(maxAttempts.get()); } if (backoffOptions.isPresent()) { BackoffOptions options = backoffOptions.get(); builder.backOffOptions(options.getInitialInterval(), options.getMultiplier(), options.getMaxInterval()); } builder.recoverer(new RejectAndDontRequeueRecoverer()); return setRetryOpertations(builder.build()); } }
@Bean public RetryOperationsInterceptor rabbitSourceRetryInterceptor() { return RetryInterceptorBuilder.stateless() .maxAttempts(this.properties.getMaxAttempts()) .backOffOptions(this.properties.getInitialRetryInterval(), this.properties.getRetryMultiplier(), this.properties.getMaxRetryInterval()) .recoverer(new RejectAndDontRequeueRecoverer()) .build(); }
@Bean public RetryOperationsInterceptor rabbitSourceRetryInterceptor() { return RetryInterceptorBuilder.stateless() .maxAttempts(this.properties.getMaxAttempts()) .backOffOptions(this.properties.getInitialRetryInterval(), this.properties.getRetryMultiplier(), this.properties.getMaxRetryInterval()) .recoverer(new RejectAndDontRequeueRecoverer()) .build(); }
retryTemplate.setRetryContextCache(cache); fb.setRetryOperations(retryTemplate); fb.setMessageRecoverer(new RejectAndDontRequeueRecoverer());
retryTemplate.setRetryContextCache(cache); fb.setRetryOperations(retryTemplate); fb.setMessageRecoverer(new RejectAndDontRequeueRecoverer());
private final RejectAndDontRequeueRecoverer recoverer = new RejectAndDontRequeueRecoverer();
private final RejectAndDontRequeueRecoverer recoverer = new RejectAndDontRequeueRecoverer();