Fixed Sonar issues
Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
@@ -22,12 +22,13 @@ import com.google.common.collect.Maps;
|
||||
*/
|
||||
@ConfigurationProperties("hawkbit.dmf.rabbitmq.deadLetter")
|
||||
public class AmqpDeadletterProperties {
|
||||
private static final int THREE_WEEKS = 21;
|
||||
|
||||
/**
|
||||
* Message time to live (ttl) for the deadletter queue. Default ttl is 3
|
||||
* weeks.
|
||||
*/
|
||||
private long ttl = Duration.ofDays(21).toMillis();
|
||||
private long ttl = Duration.ofDays(THREE_WEEKS).toMillis();
|
||||
|
||||
/**
|
||||
* Return the deadletter arguments.
|
||||
|
||||
@@ -20,6 +20,16 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@ConfigurationProperties("hawkbit.dmf.rabbitmq")
|
||||
public class AmqpProperties {
|
||||
|
||||
private static final int ONE_MINUTE = 60;
|
||||
|
||||
private static final int DEFAULT_QUEUE_DECLARATION_RETRIES = 50;
|
||||
|
||||
private static final int DEFAULT_INITIAL_CONSUMERS = 3;
|
||||
|
||||
private static final int DEFAULT_PREFETCH_COUNT = 10;
|
||||
|
||||
private static final int DEFAULT_MAX_CONSUMERS = 10;
|
||||
|
||||
/**
|
||||
* Enable DMF API based on AMQP 0.9
|
||||
*/
|
||||
@@ -54,24 +64,24 @@ public class AmqpProperties {
|
||||
/**
|
||||
* Requested heartbeat interval from broker in {@link TimeUnit#SECONDS}.
|
||||
*/
|
||||
private int requestedHeartBeat = (int) TimeUnit.SECONDS.toSeconds(60);
|
||||
private int requestedHeartBeat = (int) TimeUnit.SECONDS.toSeconds(ONE_MINUTE);
|
||||
|
||||
/**
|
||||
* Sets an upper limit to the number of consumers.
|
||||
*/
|
||||
private int maxConcurrentConsumers = 10;
|
||||
private int maxConcurrentConsumers = DEFAULT_MAX_CONSUMERS;
|
||||
|
||||
/**
|
||||
* Tells the broker how many messages to send to each consumer in a single
|
||||
* request. Often this can be set quite high to improve throughput.
|
||||
*/
|
||||
private int prefetchCount = 10;
|
||||
private int prefetchCount = DEFAULT_PREFETCH_COUNT;
|
||||
|
||||
/**
|
||||
* Initial number of consumers. Is scaled up if necessary up to
|
||||
* {@link #maxConcurrentConsumers}.
|
||||
*/
|
||||
private int initialConcurrentConsumers = 3;
|
||||
private int initialConcurrentConsumers = DEFAULT_INITIAL_CONSUMERS;
|
||||
|
||||
/**
|
||||
* The number of retry attempts when passive queue declaration fails.
|
||||
@@ -79,7 +89,7 @@ public class AmqpProperties {
|
||||
* consuming from multiple queues, when not all queues were available during
|
||||
* initialization.
|
||||
*/
|
||||
private int declarationRetries = 50;
|
||||
private int declarationRetries = DEFAULT_QUEUE_DECLARATION_RETRIES;
|
||||
|
||||
public int getDeclarationRetries() {
|
||||
return declarationRetries;
|
||||
|
||||
Reference in New Issue
Block a user