diff --git a/backends-common/rabbitmq/src/main/java/org/apache/james/backends/rabbitmq/RabbitMQConfiguration.java b/backends-common/rabbitmq/src/main/java/org/apache/james/backends/rabbitmq/RabbitMQConfiguration.java index 203ef0714ec..0535a96a6f2 100644 --- a/backends-common/rabbitmq/src/main/java/org/apache/james/backends/rabbitmq/RabbitMQConfiguration.java +++ b/backends-common/rabbitmq/src/main/java/org/apache/james/backends/rabbitmq/RabbitMQConfiguration.java @@ -883,6 +883,10 @@ public Optional getQuorumQueueDeliveryLimit() { return quorumQueueDeliveryLimit; } + public int getQuorumQueueReplicationFactor() { + return quorumQueueReplicationFactor; + } + public boolean eventBusPropagateDispatchError() { return eventBusPropagateDispatchError; } diff --git a/backends-common/rabbitmq/src/test/java/org/apache/james/backends/rabbitmq/RabbitMQConfigurationTest.java b/backends-common/rabbitmq/src/test/java/org/apache/james/backends/rabbitmq/RabbitMQConfigurationTest.java index d18f34c84e6..df747723d18 100644 --- a/backends-common/rabbitmq/src/test/java/org/apache/james/backends/rabbitmq/RabbitMQConfigurationTest.java +++ b/backends-common/rabbitmq/src/test/java/org/apache/james/backends/rabbitmq/RabbitMQConfigurationTest.java @@ -682,6 +682,22 @@ void hostsShouldParseIfSpecified() { Host.from("rabbitmqhost2", 5672)); } + @Test + void shouldReturnQuorumQueueReplicationFactorWhenConfigured() { + PropertiesConfiguration configuration = new PropertiesConfiguration(); + String amqpUri = "amqp://james:james@rabbitmqhost:5672"; + configuration.addProperty("uri", amqpUri); + String managementUri = "http://james:james@rabbitmqhost:15672/api/"; + configuration.addProperty("management.uri", managementUri); + configuration.addProperty("management.user", DEFAULT_USER); + configuration.addProperty("management.password", DEFAULT_PASSWORD_STRING); + + configuration.addProperty("quorum.queues.replication.factor", 3); + + assertThat(RabbitMQConfiguration.from(configuration).getQuorumQueueReplicationFactor()) + .isEqualTo(3); + } + @Nested class SSLConfigurationTest {