From 74e8210f6e2dc6bd7cd32948c62e4b3b115f0d32 Mon Sep 17 00:00:00 2001 From: Mohammad Iqbal Date: Mon, 25 Mar 2024 14:13:08 +0000 Subject: [PATCH 1/2] [PRMT-4677] - Defined ActiveMqConnectionFactory trusted packages within ActiveMQConfig.java --- .../nhs/prm/repo/ehrtransferservice/config/ActiveMQConfig.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/uk/nhs/prm/repo/ehrtransferservice/config/ActiveMQConfig.java b/src/main/java/uk/nhs/prm/repo/ehrtransferservice/config/ActiveMQConfig.java index 1ba9f76cf..a63ae0ef7 100644 --- a/src/main/java/uk/nhs/prm/repo/ehrtransferservice/config/ActiveMQConfig.java +++ b/src/main/java/uk/nhs/prm/repo/ehrtransferservice/config/ActiveMQConfig.java @@ -9,6 +9,8 @@ import org.springframework.context.annotation.Configuration; import org.springframework.jms.config.DefaultJmsListenerContainerFactory; +import java.util.List; + @Configuration public class ActiveMQConfig { @@ -41,6 +43,7 @@ public DefaultJmsListenerContainerFactory myFactory(ConnectionFactory connection @Bean public ConnectionFactory connectionFactory() { ActiveMQConnectionFactory activeMQConnectionFactory = new ActiveMQConnectionFactory(); + activeMQConnectionFactory.setTrustedPackages(List.of("uk.nhs.prm.repo.ehrtransferservice")); activeMQConnectionFactory.setBrokerURL(failoverUrl()); activeMQConnectionFactory.setPassword(brokerPassword); activeMQConnectionFactory.setUserName(brokerUsername); From b0cc8022710f9e451f55a01f7cb5ea89c75ed708 Mon Sep 17 00:00:00 2001 From: Mohammad Iqbal Date: Mon, 25 Mar 2024 14:43:23 +0000 Subject: [PATCH 2/2] [PRMT-4677] - Replaced List.of() with Collections.singletonList() --- .../prm/repo/ehrtransferservice/config/ActiveMQConfig.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/uk/nhs/prm/repo/ehrtransferservice/config/ActiveMQConfig.java b/src/main/java/uk/nhs/prm/repo/ehrtransferservice/config/ActiveMQConfig.java index a63ae0ef7..38d933e3b 100644 --- a/src/main/java/uk/nhs/prm/repo/ehrtransferservice/config/ActiveMQConfig.java +++ b/src/main/java/uk/nhs/prm/repo/ehrtransferservice/config/ActiveMQConfig.java @@ -9,7 +9,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.jms.config.DefaultJmsListenerContainerFactory; -import java.util.List; +import java.util.Collections; @Configuration public class ActiveMQConfig { @@ -43,7 +43,7 @@ public DefaultJmsListenerContainerFactory myFactory(ConnectionFactory connection @Bean public ConnectionFactory connectionFactory() { ActiveMQConnectionFactory activeMQConnectionFactory = new ActiveMQConnectionFactory(); - activeMQConnectionFactory.setTrustedPackages(List.of("uk.nhs.prm.repo.ehrtransferservice")); + activeMQConnectionFactory.setTrustedPackages(Collections.singletonList("uk.nhs.prm.repo.ehrtransferservice")); activeMQConnectionFactory.setBrokerURL(failoverUrl()); activeMQConnectionFactory.setPassword(brokerPassword); activeMQConnectionFactory.setUserName(brokerUsername);