Skip to content

Commit

Permalink
修复producer,consumer配置接口多处调用被覆盖的bug (#308)
Browse files Browse the repository at this point in the history
* broker管理接口修改
* openapi添加消费者监控
* 修复producer,consumer配置接口多处调用被覆盖的bug
* broker管理页搜索速度优化
* openapi更新监控接口
  • Loading branch information
iamazy committed Oct 10, 2020
1 parent 95b3f5e commit 5ef6043
Show file tree
Hide file tree
Showing 13 changed files with 225 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,28 @@ public class ConsumerConfig extends BaseNsrModel {
/**
* 开启就近机房消费
**/
private boolean nearBy;
private Boolean nearBy;

/**
* 是否暂停消费
**/
private boolean paused;
private Boolean paused;

/**
* 是否需要归档,默认不归档
**/
private boolean archive;
private Boolean archive;

/**
* 是否启用重试服务,默认开启
**/
private boolean retry = true;
private Boolean retry = true;

/**
* 延迟时间,最大延迟1小时
*/
@Max(3600000)
private int delay = 0;
private Integer delay = 0;

/**
* 偏移量管理类型
Expand All @@ -62,56 +62,56 @@ public class ConsumerConfig extends BaseNsrModel {
* 应答超时时间,默认2min
*/
@Min(0)
private int ackTimeout = 120000;
private Integer ackTimeout = 120000;

/**
* 批量大小,默认10
**/
@Min(0)
@Max(127)
private int batchSize = 10;
private Integer batchSize = 10;

/**
* 最大重试次数(无限制)
**/
@Min(0)
private int maxRetrys;
private Integer maxRetrys;

/**
* 最大重试间隔(默认5分钟)
**/
@Min(0)
private int maxRetryDelay;
private Integer maxRetryDelay;

/**
* 重试间隔
*/
@Min(0)
private int retryDelay;
private Integer retryDelay;

private String region;

/**
* 指数增加间隔时间
**/
private boolean useExponentialBackOff = true;
private Boolean useExponentialBackOff = true;

/**
* 指数系数
*/
@Min(0)
private double backOffMultiplier;
private Double backOffMultiplier;

/**
* 过期时间(默认3天)
**/
@Min(0)
private int expireTime;
private Integer expireTime;

/**
* 单队列并行度
**/
private int concurrent = 1;
private Integer concurrent = 1;

/**
* 黑名单
Expand All @@ -120,14 +120,14 @@ public class ConsumerConfig extends BaseNsrModel {

private String filters;

private int limitTps;
private Integer limitTps;

private int limitTraffic;
private Integer limitTraffic;

private Map<String, String> params;


public boolean isNearBy() {
public Boolean isNearBy() {
return nearBy;
}

Expand All @@ -143,103 +143,103 @@ public void setConsumerId(String consumerId) {
this.consumerId = consumerId;
}

public boolean isPaused() {
public Boolean isPaused() {
return paused;
}

public void setPaused(boolean paused) {
this.paused = paused;
}

public boolean isArchive() {
public Boolean isArchive() {
return archive;
}

public void setArchive(boolean archive) {
this.archive = archive;
}

public boolean isRetry() {
public Boolean isRetry() {
return retry;
}

public void setRetry(boolean retry) {
this.retry = retry;
}

public int getDelay() {
public Integer getDelay() {
return delay;
}

public void setDelay(int delay) {
this.delay = delay;
}

public int getAckTimeout() {
public Integer getAckTimeout() {
return ackTimeout;
}

public void setAckTimeout(int ackTimeout) {
this.ackTimeout = ackTimeout;
}

public int getBatchSize() {
public Integer getBatchSize() {
return batchSize;
}

public void setBatchSize(int batchSize) {
this.batchSize = batchSize;
}

public int getMaxRetrys() {
public Integer getMaxRetrys() {
return maxRetrys;
}

public void setMaxRetrys(int maxRetrys) {
this.maxRetrys = maxRetrys;
}

public int getMaxRetryDelay() {
public Integer getMaxRetryDelay() {
return maxRetryDelay;
}

public void setMaxRetryDelay(int maxRetryDelay) {
this.maxRetryDelay = maxRetryDelay;
}

public int getRetryDelay() {
public Integer getRetryDelay() {
return retryDelay;
}

public void setRetryDelay(int retryDelay) {
this.retryDelay = retryDelay;
}

public boolean isUseExponentialBackOff() {
public Boolean isUseExponentialBackOff() {
return useExponentialBackOff;
}

public void setUseExponentialBackOff(boolean useExponentialBackOff) {
this.useExponentialBackOff = useExponentialBackOff;
}

public double getBackOffMultiplier() {
public Double getBackOffMultiplier() {
return backOffMultiplier;
}

public void setBackOffMultiplier(double backOffMultiplier) {
this.backOffMultiplier = backOffMultiplier;
}

public int getExpireTime() {
public Integer getExpireTime() {
return expireTime;
}

public void setExpireTime(int expireTime) {
this.expireTime = expireTime;
}

public int getConcurrent() {
public Integer getConcurrent() {
return concurrent;
}

Expand Down Expand Up @@ -267,15 +267,15 @@ public void setLimitTps(int limitTps) {
this.limitTps = limitTps;
}

public int getLimitTps() {
public Integer getLimitTps() {
return limitTps;
}

public void setLimitTraffic(int limitTraffic) {
this.limitTraffic = limitTraffic;
}

public int getLimitTraffic() {
public Integer getLimitTraffic() {
return limitTraffic;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class ProducerConfig extends BaseNsrModel {
/**
* 是否就近发送
**/
private boolean nearBy;
private Boolean nearBy;

/**
* 集群实例发送权重
Expand All @@ -38,18 +38,18 @@ public class ProducerConfig extends BaseNsrModel {
/**
* 是否归档
*/
private boolean archive;
private Boolean archive;

/**
* 单个发送者
**/
private boolean single = false;
private Boolean single = false;

private String blackList;

private int limitTps;
private Integer limitTps;

private int limitTraffic;
private Integer limitTraffic;

private Integer timeout;

Expand All @@ -66,7 +66,7 @@ public void setProducerId(String producerId) {
this.producerId = producerId;
}

public boolean isNearBy() {
public Boolean isNearBy() {
return nearBy;
}

Expand All @@ -82,15 +82,15 @@ public void setWeight(String weight) {
this.weight = weight;
}

public boolean isSingle() {
public Boolean isSingle() {
return single;
}

public void setSingle(boolean single) {
this.single = single;
}

public boolean isArchive() {
public Boolean isArchive() {
return archive;
}

Expand All @@ -110,15 +110,15 @@ public void setLimitTps(int limitTps) {
this.limitTps = limitTps;
}

public int getLimitTps() {
public Integer getLimitTps() {
return limitTps;
}

public void setLimitTraffic(int limitTraffic) {
this.limitTraffic = limitTraffic;
}

public int getLimitTraffic() {
public Integer getLimitTraffic() {
return limitTraffic;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,19 @@
package org.joyqueue.repository;


import org.apache.ibatis.annotations.Param;
import org.joyqueue.model.domain.BrokerGroupRelated;
import org.joyqueue.model.query.QBrokerGroupRelated;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
* Created by lining on 16-11-28.
*/
@Repository
public interface BrokerGroupRelatedRepository extends PageRepository<BrokerGroupRelated,QBrokerGroupRelated> {
int updateGroupByGroupId(BrokerGroupRelated brokerGroupRelated);
int deleteByGroupId(long groupId);
List<BrokerGroupRelated> findByBrokerIds(@Param("brokerIds") List<Long> brokerIds);
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@
WHERE b.id=#{id}
</select>

<select id="findByBrokerIds" parameterType="long" resultType="BrokerGroupRelated">
<include refid="select"/>
WHERE b.id in
<foreach collection="brokerIds" item="id" index="i" open="(" separator="," close=")">
#{id}
</foreach>
</select>

<select id="findByIds" resultType="BrokerGroupRelated">
<include refid="select"/>
WHERE b.id IN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -496,8 +496,8 @@ public List<ApplicationToken> tokens(String app) {
}

@Override
public BrokerMonitorRecord brokerMonitor(Subscribe subscribe) {
return brokerMonitorService.find(subscribe, true);
public BrokerMonitorRecord brokerMonitor(Subscribe subscribe, boolean active) {
return brokerMonitorService.find(subscribe, active);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public interface OpenAPIService {
**/
List<ApplicationToken> tokens(String app);

BrokerMonitorRecord brokerMonitor(Subscribe subscribe);
BrokerMonitorRecord brokerMonitor(Subscribe subscribe, boolean active);


}

0 comments on commit 5ef6043

Please sign in to comment.