Class IdempotencyAutoConfiguration

java.lang.Object
io.github.ravocode.avoonce.spring.IdempotencyAutoConfiguration

@AutoConfiguration @AutoConfigureAfter({CaffeineIdempotencyAutoConfiguration.class,JdbcIdempotencyAutoConfiguration.class,RedisIdempotencyAutoConfiguration.class}) @ConditionalOnClass(IdempotencyManager.class) @EnableConfigurationProperties(IdempotencyProperties.class) public class IdempotencyAutoConfiguration extends Object
Spring Boot auto-configuration for the AvoOnce idempotency library.
  • Constructor Details

    • IdempotencyAutoConfiguration

      public IdempotencyAutoConfiguration()
      Creates a new auto-configuration instance.
  • Method Details

    • idempotencyConfig

      @Bean @ConditionalOnMissingBean public IdempotencyConfig idempotencyConfig(IdempotencyProperties properties)
      Configures the core IdempotencyConfig based on application properties.
      Parameters:
      properties - idempotency configuration properties.
      Returns:
      the shared IdempotencyConfig bean.
    • ambiguousStoreGuard

      @Bean @ConditionalOnClass(name={"io.github.ravocode.avoonce.caffeine.CaffeineIdempotencyRepository","io.github.ravocode.avoonce.jdbc.JdbcIdempotencyRepository"}) @ConditionalOnBean(DataSource.class) @ConditionalOnProperty(prefix="avoonce.idempotency", name="store", havingValue="auto", matchIfMissing=true) public org.springframework.beans.factory.InitializingBean ambiguousStoreGuard()
      Fail-fast bean that throws an IllegalStateException if multiple storage backends are on the classpath without an explicit avoonce.idempotency.store property set.
      Returns:
      an InitializingBean guard.
    • idempotencyManager

      @Bean @ConditionalOnMissingBean public IdempotencyManager idempotencyManager(IdempotencyRepository repository)
      Creates the primary IdempotencyManager bean backed by the resolved IdempotencyRepository.
      Parameters:
      repository - the backing store for idempotency records.
      Returns:
      the core IdempotencyManager bean.
    • idempotencyFilterRegistration

      @Bean @ConditionalOnMissingBean @ConditionalOnProperty(prefix="avoonce.idempotency.filter", name="enabled", matchIfMissing=true) @ConditionalOnClass(name="jakarta.servlet.Filter") public org.springframework.boot.web.servlet.FilterRegistrationBean<IdempotencyFilter> idempotencyFilterRegistration(IdempotencyManager manager, IdempotencyProperties properties, org.springframework.beans.factory.ObjectProvider<org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping> handlerMappingProvider)
      Registers the IdempotencyFilter as a Spring Boot servlet filter.
      Parameters:
      manager - the core idempotency state machine.
      properties - idempotency configuration properties.
      handlerMappingProvider - provider for Spring's RequestMappingHandlerMapping.
      Returns:
      the filter registration bean.