Skip to content

Commit

Permalink
rename and log level changed
Browse files Browse the repository at this point in the history
  • Loading branch information
Xin Zheng committed Oct 28, 2024
1 parent 88eb524 commit b064f02
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 3 additions & 1 deletion src/main/java/org/swisspush/redisques/RedisQues.java
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,9 @@ private Future<Void> checkQueues() {
if (notifyConsumerEvent.failed()) log.warn("TODO error handling",
exceptionFactory.newException("notifyConsumer(" + queueName + ") failed",
notifyConsumerEvent.cause()));
log.debug("refreshRegistration for queue {} time used is {} ms", queueName, System.currentTimeMillis() - perQueueStartTs);
if (log.isTraceEnabled()) {
log.trace("refreshRegistration for queue {} time used is {} ms", queueName, System.currentTimeMillis() - perQueueStartTs);
}
onDone.accept(null, null);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public class RedisquesConfiguration {
public static final String PROP_METRIC_STORAGE_NAME = "metric-storage-name";
public static final String PROP_METRIC_REFRESH_PERIOD = "metric-refresh-period";
public static final String PROP_REFRESH_PERIOD = "refresh-period";
public static final String PROP_CONSUMERLOCKMULTIPLIER = "consumer-lock-multiplier";
public static final String PROP_CONSUMER_LOCK_MULTIPLIER = "consumer-lock-multiplier";
public static final String PROP_REDIS_HOST = "redisHost";
public static final String PROP_REDIS_HOST_LIST = "redisHosts";
public static final String PROP_REDIS_PORT = "redisPort";
Expand Down Expand Up @@ -383,7 +383,7 @@ public JsonObject asJsonObject() {
obj.put(PROP_METRIC_STORAGE_NAME, getMetricStorageName());
obj.put(PROP_METRIC_REFRESH_PERIOD, getMetricRefreshPeriod());
obj.put(PROP_REFRESH_PERIOD, getRefreshPeriod());
obj.put(PROP_CONSUMERLOCKMULTIPLIER, getConsumerLockMultiplier());
obj.put(PROP_CONSUMER_LOCK_MULTIPLIER, getConsumerLockMultiplier());
obj.put(PROP_REDIS_HOST, getRedisHost());
obj.put(PROP_REDIS_HOST_LIST, getRedisHosts());
obj.put(PROP_REDIS_PORT, getRedisPort());
Expand Down Expand Up @@ -445,8 +445,8 @@ public static RedisquesConfiguration fromJsonObject(JsonObject json) {
if (json.containsKey(PROP_REFRESH_PERIOD)) {
builder.refreshPeriod(json.getInteger(PROP_REFRESH_PERIOD));
}
if (json.containsKey(PROP_CONSUMERLOCKMULTIPLIER)) {
builder.consumerLockMultiplier(json.getInteger(PROP_CONSUMERLOCKMULTIPLIER));
if (json.containsKey(PROP_CONSUMER_LOCK_MULTIPLIER)) {
builder.consumerLockMultiplier(json.getInteger(PROP_CONSUMER_LOCK_MULTIPLIER));
}
if (json.containsKey(PROP_REDIS_HOST)) {
builder.redisHost(json.getString(PROP_REDIS_HOST));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public void testGetDefaultAsJsonObject(TestContext testContext) {
testContext.assertEquals(json.getString(PROP_PROCESSOR_ADDRESS), "redisques-processor");
testContext.assertEquals(json.getInteger(PROP_METRIC_REFRESH_PERIOD), 10);
testContext.assertEquals(json.getInteger(PROP_REFRESH_PERIOD), 10);
testContext.assertEquals(json.getInteger(PROP_CONSUMERLOCKMULTIPLIER), 2);
testContext.assertEquals(json.getInteger(PROP_CONSUMER_LOCK_MULTIPLIER), 2);
testContext.assertEquals(json.getString(PROP_REDIS_HOST), "localhost");
testContext.assertEquals(json.getInteger(PROP_REDIS_PORT), 6379);
testContext.assertFalse(json.getBoolean(PROP_REDIS_ENABLE_TLS));
Expand Down Expand Up @@ -219,7 +219,7 @@ public void testGetOverriddenAsJsonObject(TestContext testContext) {
testContext.assertEquals(json.getInteger(PROP_REDIS_READY_CHECK_INTERVAL_MS), 5000);
testContext.assertEquals(json.getString(PROP_PUBLISH_METRICS_ADDRESS), "eventbus-addr-1");
testContext.assertEquals(json.getString(PROP_METRIC_STORAGE_NAME), "queue");
testContext.assertEquals(json.getInteger(PROP_CONSUMERLOCKMULTIPLIER), 3);
testContext.assertEquals(json.getInteger(PROP_CONSUMER_LOCK_MULTIPLIER), 3);
// queue configurations
JsonArray queueConfigurationsJsonArray = json.getJsonArray(PROP_QUEUE_CONFIGURATIONS);
List<JsonObject> queueConfigurationJsonObjects = queueConfigurationsJsonArray.getList();
Expand Down Expand Up @@ -274,7 +274,7 @@ public void testGetOverriddenFromJsonObject(TestContext testContext) {
json.put(PROP_REDIS_PREFIX, "new_redis-prefix");
json.put(PROP_PROCESSOR_ADDRESS, "new_processor-address");
json.put(PROP_REFRESH_PERIOD, 99);
json.put(PROP_CONSUMERLOCKMULTIPLIER, 91);
json.put(PROP_CONSUMER_LOCK_MULTIPLIER, 91);
json.put(PROP_METRIC_REFRESH_PERIOD, 55);
json.put(PROP_REDIS_HOST, "newredishost");
json.put(PROP_REDIS_PORT, 4321);
Expand Down

0 comments on commit b064f02

Please sign in to comment.