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

com.zxyinfo.queue.PersistentBusProperties Maven / Gradle / Ivy

package com.zxyinfo.queue;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @author joewee
 * @version 1.0.0
 * @date 2021/9/21 20:21
 */
@ConfigurationProperties(prefix = PersistentBusProperties.PERFIX)
public class PersistentBusProperties extends PersistentQueueProperties{
  public static final String PERFIX = "transactional.outbox.persistent.bus";
  public static final String TABLE_NAME = "bus_events";
  public static final String HISTORY_TABLE_NAME = "bus_events_history";
  /**
   * 是否启用重试机制,重试机制将按照一定的时间间隔从history表中取出失败的事件重写会bus_events表实现重试
   */
  private Boolean enableRetry=false;
  /**
   * 最多重试次数,默认20次
   */
  private Integer maxRetries=20;
  /**
   * 每次重试失败后递增的时间,单位秒,默认120秒
   */
  private Long retryClaimedTime=120L;
  /**
   * Bus events 存储的数据库表
   */
  private String tableName = TABLE_NAME;
  /**
   * Bus events 存储的历史数据库表
   */
  private String historyTableName = HISTORY_TABLE_NAME;

  public void setTableName(String tableName) {
    this.tableName = tableName;
  }

  public void setHistoryTableName(String historyTableName) {
    this.historyTableName = historyTableName;
  }

  public String getTableName() {
    return this.tableName;
  }

  public String getHistoryTableName() {
    return this.historyTableName;
  }

  public Boolean getEnableRetry() {
    return enableRetry;
  }

  public void setEnableRetry(Boolean enableRetry) {
    this.enableRetry = enableRetry;
  }

  public Integer getMaxRetries() {
    return maxRetries;
  }

  public void setMaxRetries(Integer maxRetries) {
    this.maxRetries = maxRetries;
  }

  public Long getRetryClaimedTime() {
    return retryClaimedTime;
  }

  public void setRetryClaimedTime(Long retryClaimedTime) {
    this.retryClaimedTime = retryClaimedTime;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy