diff --git a/async/async-rabbit/src/main/java/org/reactivecommons/async/rabbit/communications/TopologyCreator.java b/async/async-rabbit/src/main/java/org/reactivecommons/async/rabbit/communications/TopologyCreator.java index 6451525b..74463825 100644 --- a/async/async-rabbit/src/main/java/org/reactivecommons/async/rabbit/communications/TopologyCreator.java +++ b/async/async-rabbit/src/main/java/org/reactivecommons/async/rabbit/communications/TopologyCreator.java @@ -24,7 +24,7 @@ public class TopologyCreator { public TopologyCreator(Sender sender, String queueType) { this.sender = sender; - this.queueType = queueType != null ? queueType : "classic"; + this.queueType = queueType; } public Mono declare(ExchangeSpecification exchange) { @@ -90,14 +90,17 @@ public Mono declareQueue(String name, Optional ma protected QueueSpecification fillQueueType(QueueSpecification specification) { String resolvedQueueType = this.queueType; - if (specification.isAutoDelete() || specification.isExclusive()) { + if ("quorum".equals(resolvedQueueType) + && (specification.isAutoDelete() || specification.isExclusive())) { resolvedQueueType = "classic"; } Map args = specification.getArguments(); if (args == null) { args = new HashMap<>(); } - args.put("x-queue-type", resolvedQueueType); + if (resolvedQueueType != null) { + args.put("x-queue-type", resolvedQueueType); + } specification.arguments(args); return specification; } diff --git a/docs/docs/reactive-commons/9-configuration-properties.md b/docs/docs/reactive-commons/9-configuration-properties.md index 68202648..d9a122e7 100644 --- a/docs/docs/reactive-commons/9-configuration-properties.md +++ b/docs/docs/reactive-commons/9-configuration-properties.md @@ -31,7 +31,7 @@ app: enabled: true # if you want to disable this domain you can set it to false mandatory: false # if you want to enable mandatory messages, you can set it to true, this will throw an exception if the message cannot be routed to any queue brokerType: "rabbitmq" # please don't change this value - queueType: classic # you can change the queue type to 'quorum' if your RabbitMQ cluster supports it + queueType: null # you can set to 'classic' or to 'quorum' if your RabbitMQ cluster supports it, by default it will take the virtual host default queue type flux: maxConcurrency: 250 # max concurrency of listener flow domain: diff --git a/starters/async-rabbit-starter/src/main/java/org/reactivecommons/async/rabbit/config/props/AsyncProps.java b/starters/async-rabbit-starter/src/main/java/org/reactivecommons/async/rabbit/config/props/AsyncProps.java index a0be698f..d8370f16 100644 --- a/starters/async-rabbit-starter/src/main/java/org/reactivecommons/async/rabbit/config/props/AsyncProps.java +++ b/starters/async-rabbit-starter/src/main/java/org/reactivecommons/async/rabbit/config/props/AsyncProps.java @@ -76,6 +76,6 @@ public class AsyncProps extends GenericAsyncProps { private String brokerType = "rabbitmq"; @Builder.Default - private String queueType = "classic"; // or "quorum" + private String queueType = null; // "classic" or "quorum" }