From 4d22d0048c7684f58f928da03e05eb7c8948a160 Mon Sep 17 00:00:00 2001 From: Habes Date: Fri, 27 Oct 2023 15:42:00 -0400 Subject: [PATCH] update the conditions to create beans based on eventPortal section --- .../agent/config/eventPortal/EventPortalProperties.java | 9 ++++++--- .../processor/ScanDataImportOverAllStatusProcessor.java | 4 ++-- .../ScanDataImportParseMetaInfFileProcessor.java | 4 ++-- .../ScanDataImportPersistScanFilesProcessor.java | 4 ++-- .../ScanDataImportPublishImportScanEventProcessor.java | 4 ++-- .../agent/processor/ScanDataImportStatusProcessor.java | 4 ++-- .../management/agent/processor/ScanDataProcessor.java | 4 ++-- .../management/agent/processor/ScanLogsProcessor.java | 6 +++--- .../agent/processor/ScanStatusOverAllProcessor.java | 4 ++-- .../agent/processor/ScanStatusPerRouteProcessor.java | 4 ++-- .../management/agent/publisher/HeartbeatGenerator.java | 4 +++- .../management/agent/publisher/ScanDataPublisher.java | 4 ++-- .../management/agent/publisher/ScanLogsPublisher.java | 4 ++-- .../management/agent/publisher/ScanStatusPublisher.java | 4 ++-- .../agent/route/ep/ScanDataPublisherRouteBuilder.java | 4 ++-- .../agent/route/ep/ScanLogsPublisherRouteBuilder.java | 4 ++-- .../agent/route/ep/ScanStatusPublisherRouteBuilder.java | 4 ++-- .../agent/route/manualImport/ImportRouteBuilder.java | 4 ++-- .../ScanDataImportParseMetaInfFileRouteBuilder.java | 6 +++--- .../ScanDataImportParseZipFileRouteBuilder.java | 4 ++-- .../ScanDataImportStreamFilesRouteBuilder.java | 6 +++--- .../agent/subscriber/HeartbeatMessageHandler.java | 5 +++-- 22 files changed, 53 insertions(+), 47 deletions(-) diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/config/eventPortal/EventPortalProperties.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/config/eventPortal/EventPortalProperties.java index cedc0f368..a2976b96b 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/config/eventPortal/EventPortalProperties.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/config/eventPortal/EventPortalProperties.java @@ -5,16 +5,19 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; +import java.util.List; + @Data @Configuration @PropertySource("classpath:application.yml") @ConfigurationProperties(prefix = "event-portal") public class EventPortalProperties { - private String runtimeAgentId; + private String runtimeAgentId = "standalone"; - private String organizationId; + private String organizationId = "standalone"; private String topicPrefix; - private GatewayProperties gateway; + private GatewayProperties gateway + = new GatewayProperties("standalone", "standalone", new GatewayMessagingProperties(true, false, List.of())); } diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanDataImportOverAllStatusProcessor.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanDataImportOverAllStatusProcessor.java index 9bfc73292..5a7c455c1 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanDataImportOverAllStatusProcessor.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanDataImportOverAllStatusProcessor.java @@ -5,13 +5,13 @@ import lombok.extern.slf4j.Slf4j; import org.apache.camel.Exchange; import org.apache.camel.Processor; -import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; @SuppressWarnings("unchecked") @Slf4j @Component -@ConditionalOnExpression("${eventPortal.gateway.messaging.standalone} == false") +@ConditionalOnProperty(name = "event-portal.gateway.messaging.standalone", havingValue = "false") public class ScanDataImportOverAllStatusProcessor implements Processor { @Override diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanDataImportParseMetaInfFileProcessor.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanDataImportParseMetaInfFileProcessor.java index 9516d2c14..7fafc220e 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanDataImportParseMetaInfFileProcessor.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanDataImportParseMetaInfFileProcessor.java @@ -6,7 +6,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.camel.Exchange; import org.apache.camel.Processor; -import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; import java.util.List; @@ -16,7 +16,7 @@ @Slf4j @Component -@ConditionalOnExpression("${eventPortal.gateway.messaging.standalone} == false") +@ConditionalOnProperty(name = "event-portal.gateway.messaging.standalone", havingValue = "false") public class ScanDataImportParseMetaInfFileProcessor implements Processor { @Override diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanDataImportPersistScanFilesProcessor.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanDataImportPersistScanFilesProcessor.java index 9c4fcd794..ded035af8 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanDataImportPersistScanFilesProcessor.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanDataImportPersistScanFilesProcessor.java @@ -9,14 +9,14 @@ import lombok.extern.slf4j.Slf4j; import org.apache.camel.Exchange; import org.apache.camel.Processor; -import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; import java.util.Map; @Slf4j @Component -@ConditionalOnExpression("${eventPortal.gateway.messaging.standalone} == false") +@ConditionalOnProperty(name = "event-portal.gateway.messaging.standalone", havingValue = "false") public class ScanDataImportPersistScanFilesProcessor implements Processor { private final ScanTypeService scanTypeService; diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanDataImportPublishImportScanEventProcessor.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanDataImportPublishImportScanEventProcessor.java index 3cb83602e..54da33bd9 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanDataImportPublishImportScanEventProcessor.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanDataImportPublishImportScanEventProcessor.java @@ -8,7 +8,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.camel.Exchange; import org.apache.camel.Processor; -import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; import java.util.HashMap; @@ -18,7 +18,7 @@ @Slf4j @Component -@ConditionalOnExpression("${eventPortal.gateway.messaging.standalone} == false") +@ConditionalOnProperty(name = "event-portal.gateway.messaging.standalone", havingValue = "false") public class ScanDataImportPublishImportScanEventProcessor implements Processor { private final String orgId; private final String runtimeAgentId; diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanDataImportStatusProcessor.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanDataImportStatusProcessor.java index c031da372..c89580f6e 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanDataImportStatusProcessor.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanDataImportStatusProcessor.java @@ -6,12 +6,12 @@ import lombok.extern.slf4j.Slf4j; import org.apache.camel.Exchange; import org.apache.camel.Processor; -import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; @Slf4j @Component -@ConditionalOnExpression("${eventPortal.gateway.messaging.standalone} == false") +@ConditionalOnProperty(name = "event-portal.gateway.messaging.standalone", havingValue = "false") public class ScanDataImportStatusProcessor implements Processor { @Override public void process(Exchange exchange) throws Exception { diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanDataProcessor.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanDataProcessor.java index 6ed3d73d8..39a7e705b 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanDataProcessor.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanDataProcessor.java @@ -9,7 +9,7 @@ import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; import java.time.Instant; @@ -19,7 +19,7 @@ @Slf4j @Component -@ConditionalOnExpression("${eventPortal.gateway.messaging.standalone} == false") +@ConditionalOnProperty(name = "event-portal.gateway.messaging.standalone", havingValue = "false") public class ScanDataProcessor implements Processor { private final ScanDataPublisher scanDataPublisher; diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanLogsProcessor.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanLogsProcessor.java index 7148f44ca..fd0e1cc58 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanLogsProcessor.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanLogsProcessor.java @@ -3,13 +3,13 @@ import ch.qos.logback.classic.spi.ILoggingEvent; import com.solace.maas.ep.common.messages.ScanLogMessage; import com.solace.maas.ep.event.management.agent.config.eventPortal.EventPortalProperties; -import com.solace.maas.ep.event.management.agent.publisher.ScanLogsPublisher; import com.solace.maas.ep.event.management.agent.plugin.constants.RouteConstants; +import com.solace.maas.ep.event.management.agent.publisher.ScanLogsPublisher; import lombok.extern.slf4j.Slf4j; import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; import java.util.HashMap; @@ -17,7 +17,7 @@ @Slf4j @Component -@ConditionalOnExpression("${eventPortal.gateway.messaging.standalone} == false") +@ConditionalOnProperty(name = "event-portal.gateway.messaging.standalone", havingValue = "false") public class ScanLogsProcessor implements Processor { private final String orgId; private final String runtimeAgentId; diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanStatusOverAllProcessor.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanStatusOverAllProcessor.java index cb26d325b..83463b014 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanStatusOverAllProcessor.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanStatusOverAllProcessor.java @@ -8,7 +8,7 @@ import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; import java.util.Arrays; @@ -19,7 +19,7 @@ @SuppressWarnings("CPD-START") @Slf4j @Component -@ConditionalOnExpression("${eventPortal.gateway.messaging.standalone} == false") +@ConditionalOnProperty(name = "event-portal.gateway.messaging.standalone", havingValue = "false") public class ScanStatusOverAllProcessor implements Processor { private final String orgId; diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanStatusPerRouteProcessor.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanStatusPerRouteProcessor.java index 675d2aa72..efb597c2b 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanStatusPerRouteProcessor.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanStatusPerRouteProcessor.java @@ -8,7 +8,7 @@ import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; import java.util.HashMap; @@ -16,7 +16,7 @@ @Slf4j @Component -@ConditionalOnExpression("${eventPortal.gateway.messaging.standalone} == false") +@ConditionalOnProperty(name = "event-portal.gateway.messaging.standalone", havingValue = "false") @SuppressWarnings("unchecked") public class ScanStatusPerRouteProcessor implements Processor { private final String orgId; diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/publisher/HeartbeatGenerator.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/publisher/HeartbeatGenerator.java index bead520e0..8fb835f08 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/publisher/HeartbeatGenerator.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/publisher/HeartbeatGenerator.java @@ -6,6 +6,7 @@ import com.solace.maas.ep.event.management.agent.plugin.jacoco.ExcludeFromJacocoGeneratedReport; import com.solace.maas.ep.event.management.agent.plugin.publisher.SolacePublisher; import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.info.BuildProperties; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; @@ -14,7 +15,8 @@ @ExcludeFromJacocoGeneratedReport @Component -@ConditionalOnExpression("${eventPortal.gateway.messaging.standalone} == false and ${eventPortal.gateway.messaging.enableHeartbeats}") +@ConditionalOnExpression("${eventPortal.gateway.messaging.enableHeartbeats}") +@ConditionalOnProperty(name = "event-portal.gateway.messaging.standalone", havingValue = "false") public class HeartbeatGenerator { private final SolacePublisher solacePublisher; diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/publisher/ScanDataPublisher.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/publisher/ScanDataPublisher.java index bad2fc88d..e334d584c 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/publisher/ScanDataPublisher.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/publisher/ScanDataPublisher.java @@ -2,13 +2,13 @@ import com.solace.maas.ep.event.management.agent.plugin.mop.MOPMessage; import com.solace.maas.ep.event.management.agent.plugin.publisher.SolacePublisher; -import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; import java.util.Map; @Component -@ConditionalOnExpression("${eventPortal.gateway.messaging.standalone} == false") +@ConditionalOnProperty(name = "event-portal.gateway.messaging.standalone", havingValue = "false") public class ScanDataPublisher { private final SolacePublisher solacePublisher; diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/publisher/ScanLogsPublisher.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/publisher/ScanLogsPublisher.java index 049ecf04d..e9826e716 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/publisher/ScanLogsPublisher.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/publisher/ScanLogsPublisher.java @@ -3,7 +3,7 @@ import com.solace.maas.ep.common.messages.ScanLogMessage; import com.solace.maas.ep.event.management.agent.plugin.publisher.SolacePublisher; import lombok.extern.slf4j.Slf4j; -import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; import java.util.Map; @@ -11,7 +11,7 @@ @Component @Slf4j -@ConditionalOnExpression("${eventPortal.gateway.messaging.standalone} == false") +@ConditionalOnProperty(name = "event-portal.gateway.messaging.standalone", havingValue = "false") public class ScanLogsPublisher { private final SolacePublisher solacePublisher; diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/publisher/ScanStatusPublisher.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/publisher/ScanStatusPublisher.java index 439d5236a..b71228367 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/publisher/ScanStatusPublisher.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/publisher/ScanStatusPublisher.java @@ -7,7 +7,7 @@ import com.solace.maas.ep.event.management.agent.plugin.route.exceptions.ScanOverallStatusException; import com.solace.maas.ep.event.management.agent.plugin.route.exceptions.ScanStatusException; import lombok.extern.slf4j.Slf4j; -import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; import java.util.Arrays; @@ -16,7 +16,7 @@ @Slf4j @Component -@ConditionalOnExpression("${eventPortal.gateway.messaging.standalone} == false") +@ConditionalOnProperty(name = "event-portal.gateway.messaging.standalone", havingValue = "false") public class ScanStatusPublisher { private final SolacePublisher solacePublisher; diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/route/ep/ScanDataPublisherRouteBuilder.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/route/ep/ScanDataPublisherRouteBuilder.java index 0f7a95124..ab424bf1b 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/route/ep/ScanDataPublisherRouteBuilder.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/route/ep/ScanDataPublisherRouteBuilder.java @@ -4,11 +4,11 @@ import com.solace.maas.ep.event.management.agent.plugin.route.handler.base.AbstractRouteBuilder; import com.solace.maas.ep.event.management.agent.processor.ScanDataProcessor; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; @Component -@ConditionalOnExpression("${eventPortal.gateway.messaging.standalone} == false") +@ConditionalOnProperty(name = "event-portal.gateway.messaging.standalone", havingValue = "false") public class ScanDataPublisherRouteBuilder extends AbstractRouteBuilder { private final ScanDataProcessor processor; diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/route/ep/ScanLogsPublisherRouteBuilder.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/route/ep/ScanLogsPublisherRouteBuilder.java index 12d263d3f..7e17a89f3 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/route/ep/ScanLogsPublisherRouteBuilder.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/route/ep/ScanLogsPublisherRouteBuilder.java @@ -3,11 +3,11 @@ import com.solace.maas.ep.event.management.agent.processor.ScanLogsProcessor; import org.apache.camel.builder.RouteBuilder; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; @Component -@ConditionalOnExpression("${eventPortal.gateway.messaging.standalone} == false") +@ConditionalOnProperty(name = "event-portal.gateway.messaging.standalone", havingValue = "false") public class ScanLogsPublisherRouteBuilder extends RouteBuilder { private final ScanLogsProcessor scanLogsProcessor; diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/route/ep/ScanStatusPublisherRouteBuilder.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/route/ep/ScanStatusPublisherRouteBuilder.java index 2e8319555..be20bc536 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/route/ep/ScanStatusPublisherRouteBuilder.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/route/ep/ScanStatusPublisherRouteBuilder.java @@ -6,12 +6,12 @@ import com.solace.maas.ep.event.management.agent.processor.ScanStatusOverAllProcessor; import com.solace.maas.ep.event.management.agent.processor.ScanStatusPerRouteProcessor; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Profile; import org.springframework.stereotype.Component; @Component -@ConditionalOnExpression("${eventPortal.gateway.messaging.standalone} == false") +@ConditionalOnProperty(name = "event-portal.gateway.messaging.standalone", havingValue = "false") @Profile("!TEST") public class ScanStatusPublisherRouteBuilder extends AbstractRouteBuilder { diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/route/manualImport/ImportRouteBuilder.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/route/manualImport/ImportRouteBuilder.java index 94ecc0abf..7358ce022 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/route/manualImport/ImportRouteBuilder.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/route/manualImport/ImportRouteBuilder.java @@ -3,14 +3,14 @@ import com.solace.maas.ep.event.management.agent.plugin.route.exceptionhandlers.ScanDataImportExceptionHandler; import org.apache.camel.Exchange; import org.apache.camel.builder.RouteBuilder; -import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; import static com.solace.maas.ep.event.management.agent.plugin.constants.RouteConstants.IMPORT_ID; import static com.solace.maas.ep.event.management.agent.plugin.constants.RouteConstants.TRACE_ID; @Component -@ConditionalOnExpression("${eventPortal.gateway.messaging.standalone} == false") +@ConditionalOnProperty(name = "event-portal.gateway.messaging.standalone", havingValue = "false") public class ImportRouteBuilder extends RouteBuilder { @Override diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/route/manualImport/ScanDataImportParseMetaInfFileRouteBuilder.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/route/manualImport/ScanDataImportParseMetaInfFileRouteBuilder.java index 127557048..2dadb56d1 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/route/manualImport/ScanDataImportParseMetaInfFileRouteBuilder.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/route/manualImport/ScanDataImportParseMetaInfFileRouteBuilder.java @@ -1,23 +1,23 @@ package com.solace.maas.ep.event.management.agent.route.manualImport; import com.solace.maas.ep.event.management.agent.plugin.constants.RouteConstants; +import com.solace.maas.ep.event.management.agent.plugin.route.exceptionhandlers.ScanDataImportExceptionHandler; import com.solace.maas.ep.event.management.agent.processor.ScanDataImportOverAllStatusProcessor; import com.solace.maas.ep.event.management.agent.processor.ScanDataImportParseMetaInfFileProcessor; import com.solace.maas.ep.event.management.agent.processor.ScanDataImportPersistFilePathsProcessor; import com.solace.maas.ep.event.management.agent.processor.ScanDataImportPersistScanDataProcessor; import com.solace.maas.ep.event.management.agent.processor.ScanDataImportPublishImportScanEventProcessor; -import com.solace.maas.ep.event.management.agent.plugin.route.exceptionhandlers.ScanDataImportExceptionHandler; import com.solace.maas.ep.event.management.agent.scanManager.model.MetaInfFileBO; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.model.dataformat.JsonLibrary; import org.apache.camel.processor.aggregate.UseLatestAggregationStrategy; -import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; import static com.solace.maas.ep.event.management.agent.plugin.constants.RouteConstants.IMPORT_ID; @Component -@ConditionalOnExpression("${eventPortal.gateway.messaging.standalone} == false") +@ConditionalOnProperty(name = "event-portal.gateway.messaging.standalone", havingValue = "false") public class ScanDataImportParseMetaInfFileRouteBuilder extends RouteBuilder { private final ScanDataImportParseMetaInfFileProcessor scanDataImportParseMetaInfFileProcessor; diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/route/manualImport/ScanDataImportParseZipFileRouteBuilder.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/route/manualImport/ScanDataImportParseZipFileRouteBuilder.java index 63b1a2665..9b043afba 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/route/manualImport/ScanDataImportParseZipFileRouteBuilder.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/route/manualImport/ScanDataImportParseZipFileRouteBuilder.java @@ -5,7 +5,7 @@ import org.apache.camel.dataformat.zipfile.ZipSplitter; import org.apache.camel.model.dataformat.ZipFileDataFormat; import org.apache.camel.processor.aggregate.UseLatestAggregationStrategy; -import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; import java.util.Iterator; @@ -13,7 +13,7 @@ import static com.solace.maas.ep.event.management.agent.plugin.constants.RouteConstants.IMPORT_ID; @Component -@ConditionalOnExpression("${eventPortal.gateway.messaging.standalone} == false") +@ConditionalOnProperty(name = "event-portal.gateway.messaging.standalone", havingValue = "false") public class ScanDataImportParseZipFileRouteBuilder extends RouteBuilder { @Override diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/route/manualImport/ScanDataImportStreamFilesRouteBuilder.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/route/manualImport/ScanDataImportStreamFilesRouteBuilder.java index 1f2cbd3b4..7dd0fb73c 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/route/manualImport/ScanDataImportStreamFilesRouteBuilder.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/route/manualImport/ScanDataImportStreamFilesRouteBuilder.java @@ -1,19 +1,19 @@ package com.solace.maas.ep.event.management.agent.route.manualImport; import com.solace.maas.ep.event.management.agent.plugin.constants.RouteConstants; +import com.solace.maas.ep.event.management.agent.plugin.route.exceptionhandlers.ScanDataImportExceptionHandler; import com.solace.maas.ep.event.management.agent.processor.ScanDataImportPersistScanFilesProcessor; import com.solace.maas.ep.event.management.agent.processor.ScanDataImportStatusProcessor; import com.solace.maas.ep.event.management.agent.route.ep.aggregation.FileParseAggregationStrategy; -import com.solace.maas.ep.event.management.agent.plugin.route.exceptionhandlers.ScanDataImportExceptionHandler; import org.apache.camel.Exchange; import org.apache.camel.builder.RouteBuilder; -import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; import static com.solace.maas.ep.event.management.agent.plugin.constants.RouteConstants.IMPORT_ID; @Component -@ConditionalOnExpression("${eventPortal.gateway.messaging.standalone} == false") +@ConditionalOnProperty(name = "event-portal.gateway.messaging.standalone", havingValue = "false") public class ScanDataImportStreamFilesRouteBuilder extends RouteBuilder { private final ScanDataImportStatusProcessor scanDataImportStatusProcessor; diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/subscriber/HeartbeatMessageHandler.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/subscriber/HeartbeatMessageHandler.java index a23f1d825..d94952642 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/subscriber/HeartbeatMessageHandler.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/subscriber/HeartbeatMessageHandler.java @@ -4,6 +4,7 @@ import com.solace.maas.ep.event.management.agent.config.SolaceConfiguration; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; /** @@ -13,9 +14,9 @@ */ @Slf4j @Component -@ConditionalOnExpression("${eventPortal.gateway.messaging.standalone} == false " + - "and ${eventPortal.gateway.messaging.enableHeartbeats} " + +@ConditionalOnExpression("${eventPortal.gateway.messaging.enableHeartbeats} " + "and ${eventPortal.gateway.messaging.testHeartbeats}") +@ConditionalOnProperty(name = "event-portal.gateway.messaging.standalone", havingValue = "false") public class HeartbeatMessageHandler extends SolaceMessageHandler { public HeartbeatMessageHandler(