Search in sources :

Example 1 with ZuulRateLimitFilter

use of com.giffing.bucket4j.spring.boot.starter.zuul.ZuulRateLimitFilter in project bucket4j-spring-boot-starter by MarcGiffing.

the class Bucket4JAutoConfigurationZuul method createZuulFilter.

private ZuulFilter createZuulFilter(int position) {
    Integer filterCount = 0;
    if (properties.getFilters().size() >= (position + 1)) {
        Bucket4JConfiguration filter = properties.getFilters().get(position);
        filterCount++;
        FilterConfiguration filterConfig = buildFilterConfig(filter, cacheManager, zuulExpressionParser(), beanFactory);
        zuulConfigurationHolder().addFilterConfiguration(filter);
        log.info("create-zuul-filter;{};{};{}", position, filter.getCacheName(), filter.getUrl());
        return new ZuulRateLimitFilter(filterConfig);
    }
    return null;
}
Also used : Bucket4JConfiguration(com.giffing.bucket4j.spring.boot.starter.context.properties.Bucket4JConfiguration) FilterConfiguration(com.giffing.bucket4j.spring.boot.starter.context.FilterConfiguration) ZuulRateLimitFilter(com.giffing.bucket4j.spring.boot.starter.zuul.ZuulRateLimitFilter)

Aggregations

FilterConfiguration (com.giffing.bucket4j.spring.boot.starter.context.FilterConfiguration)1 Bucket4JConfiguration (com.giffing.bucket4j.spring.boot.starter.context.properties.Bucket4JConfiguration)1 ZuulRateLimitFilter (com.giffing.bucket4j.spring.boot.starter.zuul.ZuulRateLimitFilter)1