/**
 * Copyright 2008-2009. Chongqing Communications Industry Services Co.,Ltd Information Technology Branch. All rights reserved. <a>http://www.crunii.com</a>
 */
package com.crunii.micro.gateway.config;
/**
 * @author 田平 create 2023-02-01 03:44:07
 * <pre>
 *     一般采用全局的redis限流
 * </pre>
 */

import com.crunii.micro.gateway.limit.GuavaBurstyRateLimiter;
import org.springframework.cloud.gateway.support.ConfigurationService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class GuavaRateLimiterConfiguration {

	/**
	 * <pre>
	 *          {
	 * 				"name": "GuavaRateLimiter",
	 * 				"args": {
	 * 					"rateLimiter": "#{@guavaBurstyRateLimiter}",
	 * 					"keyResolver": "#{@pathKeyResolver}",
	 * 					"guava-bursty-rate-limit.permitsPerSecond": 1
	 *                }
	 *            }
	 * </pre>
	 *
	 * @param configurationService
	 * @return
	 */
//	@Bean(name = "guavaBurstyRateLimiter")
//	public GuavaBurstyRateLimiter regGuavaBurstyRateLimiter(ConfigurationService configurationService) {
//		return new GuavaBurstyRateLimiter(configurationService);
//	}

}
