package com.cstiaoji.spider.configuration;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import io.rebloom.client.Client;
public class RedisConfiguration {
// 从application.yml文件中引入配置信息
@Value("${redis.bloom.url:#{null}}")
private String rebloomUrl;
@Value("${redis.bloom.port:#{null}}")
private Integer rebloomPort;
@Value("${redis.bloom.init-capacity:#{null}}")
private Integer rebloomInitCapacity;
@Value("${redis.bloom.error-rate:#{null}}")
private Double rebloomErrorRate;
public Client rebloomClient() {
Client client = new Client(rebloomUrl, rebloomPort);
client.createFilter("cstiaoji-spider", rebloomInitCapacity, rebloomErrorRate);