org.springframework.retry.interceptor.RetryOperationsInterceptor Java Examples

The following examples show how to use org.springframework.retry.interceptor.RetryOperationsInterceptor. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RetryConfiguration.java    From blade-tool with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Bean
@ConditionalOnMissingBean(name = "configServerRetryInterceptor")
public RetryOperationsInterceptor configServerRetryInterceptor() {
	log.info(String.format(
		"configServerRetryInterceptor: Changing backOffOptions " +
			"to initial: %s, multiplier: %s, maxInterval: %s",
		1000, 1.2, 5000));
	return RetryInterceptorBuilder
		.stateless()
		.backOffOptions(1000, 1.2, 5000)
		.maxAttempts(10)
		.build();
}
 
Example #2
Source File: ServiceCombConfigAutoConfiguration.java    From spring-cloud-huawei with Apache License 2.0 5 votes vote down vote up
@Bean(name = "serviceCombConfigRetryInterceptor")
@ConditionalOnMissingBean(name = "serviceCombConfigRetryInterceptor")
public RetryOperationsInterceptor serviceCombConfigRetryInterceptor(
    ServiceCombConfigProperties serviceCombConfigProperties) {
  return RetryInterceptorBuilder.stateless()
      .backOffOptions(serviceCombConfigProperties.getRetry().getInitialInterval(),
          serviceCombConfigProperties.getRetry().getMultiplier(),
          serviceCombConfigProperties.getRetry().getMaxInterval())
      .maxAttempts(serviceCombConfigProperties.getRetry().getMaxAttempts()).build();
}
 
Example #3
Source File: RetryConfiguration.java    From spring-cloud-release-tools with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean
@ConditionalOnDefaultFlowEnabled(name = "configServerRetryInterceptor")
public RetryOperationsInterceptor configServerRetryInterceptor() {
	log.info("Creating custom retry interceptor");
	return RetryInterceptorBuilder.stateless().backOffOptions(3000, 1.5, 10000).maxAttempts(10).build();
}
 
Example #4
Source File: RabbitMQRouterConfig.java    From konker-platform with Apache License 2.0 5 votes vote down vote up
@Bean
public RetryOperationsInterceptor interceptor() {
    return RetryInterceptorBuilder.stateless()
            .maxAttempts(5)
            .backOffOptions(1000, 2.0, 5000)
            .build();
}
 
Example #5
Source File: RabbitSourceConfiguration.java    From spring-cloud-stream-app-starters with Apache License 2.0 5 votes vote down vote up
@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();
}
 
Example #6
Source File: ConfigServiceBootstrapConfiguration.java    From spring-cloud-config with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean(name = "configServerRetryInterceptor")
public RetryOperationsInterceptor configServerRetryInterceptor(
		RetryProperties properties) {
	return RetryInterceptorBuilder.stateless()
			.backOffOptions(properties.getInitialInterval(),
					properties.getMultiplier(), properties.getMaxInterval())
			.maxAttempts(properties.getMaxAttempts()).build();
}
 
Example #7
Source File: ConsulAutoConfiguration.java    From spring-cloud-consul with Apache License 2.0 5 votes vote down vote up
@Bean(name = "consulRetryInterceptor")
@ConditionalOnMissingBean(name = "consulRetryInterceptor")
public RetryOperationsInterceptor consulRetryInterceptor(
		RetryProperties properties) {
	return RetryInterceptorBuilder.stateless()
			.backOffOptions(properties.getInitialInterval(),
					properties.getMultiplier(), properties.getMaxInterval())
			.maxAttempts(properties.getMaxAttempts()).build();
}
 
Example #8
Source File: RabbitConfiguration.java    From tutorials with MIT License 5 votes vote down vote up
@Bean
public RetryOperationsInterceptor retryInterceptor() {
    return RetryInterceptorBuilder.stateless()
        .backOffOptions(1000, 3.0, 10000)
        .maxAttempts(5)
        .recoverer(observableRecoverer())
        .build();
}
 
Example #9
Source File: RabbitConfiguration.java    From tutorials with MIT License 5 votes vote down vote up
@Bean
public SimpleRabbitListenerContainerFactory retryContainerFactory(ConnectionFactory connectionFactory, RetryOperationsInterceptor retryInterceptor) {
    SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
    factory.setConnectionFactory(connectionFactory);

    Advice[] adviceChain = { retryInterceptor };
    factory.setAdviceChain(adviceChain);

    return factory;
}
 
Example #10
Source File: RetryConfiguration.java    From kitty with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean(name = "configServerRetryInterceptor")
public RetryOperationsInterceptor configServerRetryInterceptor() {
	return RetryInterceptorBuilder.stateless().backOffOptions(1000, 1.2, 5000).maxAttempts(10).build();
}