All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.yizzuide.milkomeda.atom.AtomProperties Maven / Gradle / Ivy

/*
 * Copyright (c) 2021 yizzuide All rights Reserved.
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

package com.github.yizzuide.milkomeda.atom;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.convert.DurationUnit;

import java.time.Duration;
import java.time.temporal.ChronoUnit;

/**
 * AtomProperties
 *
 * @author yizzuide
 * @since 3.3.0
 * 
* Create at 2020/04/30 15:26 */ @Data @ConfigurationProperties("milkomeda.atom") public class AtomProperties { /** * 策略方式 */ private AtomStrategyType strategy = AtomStrategyType.REDIS; /** * redis配置 */ private Redis redis = new Redis(); /** * Zk配置 */ private Zk zk = new Zk(); @Data static class Redis { /** * 使用集群方案 */ private boolean useCluster = false; } @Data static class Zk { /** * 连接地址 */ private String address = "127.0.0.1:2181"; /** * 根节点名称 */ private String rootLockNode = "mk_atom_locks"; /** * 重试睡眠时间 */ @DurationUnit(ChronoUnit.MILLIS) private Duration sleepTime = Duration.ofMillis(1000); /** * 最大重试次数 */ private int maxRetry = 3; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy