Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

Commit 3d70fed

Browse files
authored
SSCS-10954 : Made the queue connection string configurable (#414)
* SSCS-10954 : Made the queue connection string configurable * SSCS-10954 : Corrected variable name * SSCS-10954 : CVE fix (jackson databind) * SSCS-10954 : Removed incorrect quotations
1 parent 1bacc44 commit 3d70fed

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/main/java/uk/gov/hmcts/reform/sscs/config/jms/TribunalsHearingsJmsConfig.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,12 @@ public class TribunalsHearingsJmsConfig {
3939
@Value("${azure.service-bus.tribunals-to-hearings-api.idleTimeout}")
4040
private Long idleTimeout;
4141

42-
public static final String AMQP_CONNECTION_STRING_TEMPLATE = "amqps://%1s?amqp.idleTimeout=%2d";
42+
@Value("${azure.service-bus.amqp-connection-string-template:amqps://%1s?amqp.idleTimeout=%2d}")
43+
public String amqpConnectionStringTemplate;
4344

4445
@Bean
4546
public ConnectionFactory tribunalsHearingsJmsConnectionFactory(@Value("${spring.application.name}") final String clientId) {
46-
String connection = String.format(AMQP_CONNECTION_STRING_TEMPLATE, namespace + connectionPostfix, idleTimeout);
47+
String connection = String.format(amqpConnectionStringTemplate, namespace + connectionPostfix, idleTimeout);
4748
JmsConnectionFactory jmsConnectionFactory = new JmsConnectionFactory(connection);
4849
jmsConnectionFactory.setUsername(username);
4950
jmsConnectionFactory.setPassword(password);

src/main/resources/application.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ feign:
7272

7373
azure:
7474
service-bus:
75-
connection-postfix: ".servicebus.windows.net"
75+
amqp-connection-string-template : ${AMQP_CONNECTION_STRING:amqps://%1s?amqp.idleTimeout=%2d}
76+
connection-postfix: ${HMC_HEARINGS_TOPIC_CONNECTION_POSTFIX:.servicebus.windows.net}
7677
hmc-to-hearings-api:
7778
namespace: ${HMC_HEARINGS_TOPIC_NAMESPACE:}
7879
topicName: ${HMC_HEARINGS_TOPIC_NAME:}

0 commit comments

Comments
 (0)