From e401e94c6f0f6e9f3d0c1be2a4efa17f798660a9 Mon Sep 17 00:00:00 2001 From: Juan Carlos Galvis Zuluaga Date: Mon, 26 Feb 2024 15:05:11 -0500 Subject: [PATCH] Add new listener type --- .../commons/jms/internal/models/MQListenerConfig.java | 7 +++++++ .../bancolombia/sample/app/config/UseCasesConfig.java | 2 +- .../reqreply/MyRequestReplyAdapter.java | 1 + .../reqreply/MyRequestReplySingleInstance.java | 11 +++++++++++ gradle.properties | 4 ++-- 5 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 examples/mq-reactive/src/main/java/co/com/bancolombia/sample/drivenadapters/reqreply/MyRequestReplySingleInstance.java diff --git a/commons-jms-utils/src/main/java/co/com/bancolombia/commons/jms/internal/models/MQListenerConfig.java b/commons-jms-utils/src/main/java/co/com/bancolombia/commons/jms/internal/models/MQListenerConfig.java index 1d656ed..50fe219 100644 --- a/commons-jms-utils/src/main/java/co/com/bancolombia/commons/jms/internal/models/MQListenerConfig.java +++ b/commons-jms-utils/src/main/java/co/com/bancolombia/commons/jms/internal/models/MQListenerConfig.java @@ -31,7 +31,14 @@ public enum SelectorMode { } public enum QueueType { + /** + * Used to get messages by selector + */ FIXED, + /** + * This assumes that you have a location transparency router or have a single instance of this consumer + */ + FIXED_SINGLE_INSTANCE, TEMPORARY } } diff --git a/examples/mq-reactive/src/main/java/co/com/bancolombia/sample/app/config/UseCasesConfig.java b/examples/mq-reactive/src/main/java/co/com/bancolombia/sample/app/config/UseCasesConfig.java index caaa511..2fbac50 100644 --- a/examples/mq-reactive/src/main/java/co/com/bancolombia/sample/app/config/UseCasesConfig.java +++ b/examples/mq-reactive/src/main/java/co/com/bancolombia/sample/app/config/UseCasesConfig.java @@ -5,7 +5,7 @@ import org.springframework.context.annotation.FilterType; @Configuration -@ComponentScan(basePackages = "co.com.bancolombia.jms.sample.domain.usecase", +@ComponentScan(basePackages = "co.com.bancolombia.sample.domain.usecase", includeFilters = { @ComponentScan.Filter(type = FilterType.REGEX, pattern = "^.+UseCase$") }, diff --git a/examples/mq-reactive/src/main/java/co/com/bancolombia/sample/drivenadapters/reqreply/MyRequestReplyAdapter.java b/examples/mq-reactive/src/main/java/co/com/bancolombia/sample/drivenadapters/reqreply/MyRequestReplyAdapter.java index 6900506..828db0c 100644 --- a/examples/mq-reactive/src/main/java/co/com/bancolombia/sample/drivenadapters/reqreply/MyRequestReplyAdapter.java +++ b/examples/mq-reactive/src/main/java/co/com/bancolombia/sample/drivenadapters/reqreply/MyRequestReplyAdapter.java @@ -19,6 +19,7 @@ @AllArgsConstructor public class MyRequestReplyAdapter implements RequestGateway { private final MyRequestReply requestReply; // domainB + private final MyRequestReplySingleInstance requestReplyFixedSingle; // domainB fixed single instance (no selector) private final MyRequestReplyTmp requestReplyTmp; // default domain private final ObjectMapper mapper; diff --git a/examples/mq-reactive/src/main/java/co/com/bancolombia/sample/drivenadapters/reqreply/MyRequestReplySingleInstance.java b/examples/mq-reactive/src/main/java/co/com/bancolombia/sample/drivenadapters/reqreply/MyRequestReplySingleInstance.java new file mode 100644 index 0000000..757fb60 --- /dev/null +++ b/examples/mq-reactive/src/main/java/co/com/bancolombia/sample/drivenadapters/reqreply/MyRequestReplySingleInstance.java @@ -0,0 +1,11 @@ +package co.com.bancolombia.sample.drivenadapters.reqreply; + +import co.com.bancolombia.commons.jms.api.MQRequestReply; +import co.com.bancolombia.commons.jms.mq.ReqReply; + +import static co.com.bancolombia.commons.jms.internal.models.MQListenerConfig.QueueType.FIXED; +import static co.com.bancolombia.commons.jms.internal.models.MQListenerConfig.QueueType.FIXED_SINGLE_INSTANCE; + +@ReqReply(requestQueue = "DEV.QUEUE.1", replyQueue = "DEV.QUEUE.2", queueType = FIXED_SINGLE_INSTANCE, connectionFactory = "domainB") +public interface MyRequestReplySingleInstance extends MQRequestReply { +} diff --git a/gradle.properties b/gradle.properties index 4d2e379..4089f17 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ -version=2.0.1 -springBootVersion=3.2.1 +version=2.0.2 +springBootVersion=3.2.3 gradleVersionsVersion=0.47.0 owaspDependencyCheckVersion=9.0.9 mqJMSVersion=3.2.1