Skip to content

Commit

Permalink
SSCS-10954 : Made the queue connection string configurable (#414)
Browse files Browse the repository at this point in the history
* SSCS-10954 : Made the queue connection string configurable

* SSCS-10954 : Corrected variable name

* SSCS-10954 : CVE fix (jackson databind)

* SSCS-10954 : Removed incorrect quotations
  • Loading branch information
ss-evoco committed Nov 17, 2022
1 parent 1bacc44 commit 3d70fed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@ public class TribunalsHearingsJmsConfig {
@Value("${azure.service-bus.tribunals-to-hearings-api.idleTimeout}")
private Long idleTimeout;

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

@Bean
public ConnectionFactory tribunalsHearingsJmsConnectionFactory(@Value("${spring.application.name}") final String clientId) {
String connection = String.format(AMQP_CONNECTION_STRING_TEMPLATE, namespace + connectionPostfix, idleTimeout);
String connection = String.format(amqpConnectionStringTemplate, namespace + connectionPostfix, idleTimeout);
JmsConnectionFactory jmsConnectionFactory = new JmsConnectionFactory(connection);
jmsConnectionFactory.setUsername(username);
jmsConnectionFactory.setPassword(password);
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ feign:

azure:
service-bus:
connection-postfix: ".servicebus.windows.net"
amqp-connection-string-template : ${AMQP_CONNECTION_STRING:amqps://%1s?amqp.idleTimeout=%2d}
connection-postfix: ${HMC_HEARINGS_TOPIC_CONNECTION_POSTFIX:.servicebus.windows.net}
hmc-to-hearings-api:
namespace: ${HMC_HEARINGS_TOPIC_NAMESPACE:}
topicName: ${HMC_HEARINGS_TOPIC_NAME:}
Expand Down

0 comments on commit 3d70fed

Please sign in to comment.