Skip to content

Commit

Permalink
SSCSSI-404: merge sscs-hearings-api into sscs-tribunals-case-api - wi… (
Browse files Browse the repository at this point in the history
#4056)

* SSCSSI-404: merge sscs-hearings-api into sscs-tribunals-case-api - with toggle ON

* SSCSSI-404: merge sscs-hearings-api into sscs-tribunals-case-api - with toggle ON

* SSCSSI-404: merge sscs-hearings-api into sscs-tribunals-case-api - with toggle ON

* SSCSSI-404: merge sscs-hearings-api into sscs-tribunals-case-api - with toggle ON

* SSCSSI-404: merge sscs-hearings-api into sscs-tribunals-case-api - with toggle ON

* SSCSSI-404: merge sscs-hearings-api into sscs-tribunals-case-api - with toggle ON

* SSCSSI-404: merge sscs-hearings-api into sscs-tribunals-case-api - with toggle ON

* SSCSSI-404: merge sscs-hearings-api into sscs-tribunals-case-api - with toggle ON

* SSCSSI-404: merge sscs-hearings-api into sscs-tribunals-case-api - with toggle ON

* SSCSSI-404: merge sscs-hearings-api into sscs-tribunals-case-api - with toggle ON

* SSCSSI-404: merge sscs-hearings-api into sscs-tribunals-case-api - with toggle ON

* SSCSSI-404: merge sscs-hearings-api into sscs-tribunals-case-api - with toggle ON

* SSCSSI-404: merge sscs-hearings-api into sscs-tribunals-case-api - with toggle ON

* SSCSSI-404: merge sscs-hearings-api into sscs-tribunals-case-api - with toggle ON

* SSCSSI-404: merge sscs-hearings-api into sscs-tribunals-case-api - with toggle ON

* SSCSSI-404: merge sscs-hearings-api into sscs-tribunals-case-api - with toggle ON

* SSCSSI-404: merge sscs-hearings-api into sscs-tribunals-case-api - with toggle ON
  • Loading branch information
srochani authored Oct 21, 2024
1 parent d30c85b commit 8125bbe
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 15 deletions.
8 changes: 8 additions & 0 deletions Jenkinsfile_CNP
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ def secrets = [
secret('tya-link', 'SSCS_TRACK_YOUR_APPEAL_LINK'),
secret('evidence-share-topic-shared-access-key', 'AMQP_PASSWORD'),

// hearing-api
secret('idam-s2s-api', 'IDAM_S2S_URL'),
secret('caseworker-ref-api', 'CASEWORKER_REF_API_URL'),
secret('ccd-api', 'CORE_CASE_DATA_API_URL'),
secret('judicial-ref-api', 'JUDICIAL_REF_API_URL'),
secret('s2s-micro', 'IDAM_S2S_AUTH_MICROSERVICES'),
secret('common-ref-data-api', 'COMMON_REF_API_URL'),

// e2es
secret('test-e2e-caseofficer-username', 'TEST_CASEOFFICER_USERNAME'),
secret('test-e2e-caseofficer-password', 'TEST_CASEOFFICER_PASSWORD'),
Expand Down
25 changes: 24 additions & 1 deletion charts/sscs-tribunals-api/values.hearings.preview.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ java:
SUBSCRIPTION_NAME: "${SERVICE_NAME}-servicebus-main-topic"
AMQP_HOST: "sscs-sb-preview.servicebus.windows.net"
AMQP_USERNAME: "RootManageSharedAccessKey"
HEARINGS_EVENT_QUEUE_NAME: ${SERVICE_NAME}-servicebus-tribunals-to-hearing-api
HEARINGS_EVENT_QUEUE_NAME: "${SERVICE_NAME}-servicebus-tribunals-to-hearing-api"
ROBOTICS_EMAIL_FROM: "sscs@hmcts.net"
ROBOTICS_EMAIL_TO: "fake"
ROBOTICS_EMAIL_SCOTTISH_TO: "fake2"
Expand All @@ -67,6 +67,26 @@ java:
HOURS_END_TIME: 23
RUN_DB_MIGRATION_ON_STARTUP: true
TEST_RECIPIENTS_POSTCODE: "*"
HMC_HEARINGS_LISTENING_ENABLED: true
TRIBUNALS_HEARINGS_LISTENING_ENABLED: true
EXUI_API_URL: "https://${SERVICE_NAME}-xui"
IDAM_S2S_URL: "http://rpe-service-auth-provider-aat.service.core-compute-aat.internal"
CASEWORKER_REF_API_URL: "http://rd-caseworker-ref-api-aat.service.core-compute-aat.internal"
COMMON_REF_API_URL: "http://rd-commondata-api-aat.service.core-compute-aat.internal"
JUDICIAL_REF_API_URL: "http://rd-judicial-api-aat.service.core-compute-aat.internal"
HMC_API_URL: "http://hmc-cft-hearing-service-aat.service.core-compute-aat.internal"
#Messaging
HMC_HEARINGS_TOPIC_NAME: "hmc-to-cft-aat"
HMC_HEARINGS_TOPIC_SUBSCRIPTION_NAME: "hmc-to-sscs-subscription-pr-4056"
TRIBUNALS_EVENT_QUEUE_NAME: "${SERVICE_NAME}-servicebus-tribunals-to-hearing-api"
TRIBUNALS_EVENT_QUEUE_POLICY_NAME: "RootManageSharedAccessKey"
TRIBUNALS_EVENT_QUEUE_NAMESPACE: "sscs-sb-preview"
HMC_HEARINGS_TOPIC_NAMESPACE: "hmc-servicebus-aat"
HMC_DEPLOYMENT_ID: "deployment-${SERVICE_NAME}"
HMC_DEPLOYMENT_FILTER_ENABLED: true
HEARINGS_CASE_UPDATE_V2_ENABLED: true
ADJOURNMENT_ENABLED: true
BYPASS_HEARING_API_SERVICE: true
secrets:
JOB_SCHEDULER_DB_PASSWORD:
secretRef: postgres
Expand All @@ -77,6 +97,9 @@ java:
AMQP_PASSWORD:
secretRef: sscs-sb-preview
key: primaryKey
TRIBUNALS_EVENT_QUEUE_ACCESS_KEY:
secretRef: sscs-sb-preview
key: primaryKey
postgresql:
enabled: false

Expand Down
8 changes: 5 additions & 3 deletions charts/sscs-tribunals-api/values.preview.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ java:
CITIZEN_LOGIN_SERVICE_V2: true
ADD_LINK_TO_OTHER_ASSOCIATED_CASES_V2: true
BYPASS_NOTIFICATIONS_SERVICE: true
BYPASS_HEARING_API_SERVICE: true
HANDLE_CCD_CALLBACKMAP_V2: true
TESTING_SUPPORT_ENABLED: true
TOPIC_NAME: "${SERVICE_NAME}-servicebus-main-topic"
Expand Down Expand Up @@ -148,7 +149,7 @@ xui-webapp:
SERVICES_IDAM_API_URL: https://idam-api.aat.platform.hmcts.net
SERVICES_S2S: http://rpe-service-auth-provider-aat.service.core-compute-aat.internal
SERVICES_HEARINGS_COMPONENT_API: http://jurisdiction-hearings-api-aat.service.core-compute-aat.internal
SERVICES_HEARINGS_COMPONENT_API_SSCS: http://${SERVICE_NAME}-sscs-hearings-api
SERVICES_HEARINGS_COMPONENT_API_SSCS: http://${SERVICE_NAME}-java
SERVICES_PRD_LOCATION_API: http://rd-location-ref-api-aat.service.core-compute-aat.internal
SERVICES_PRD_JUDICIAL_API: http://rd-judicial-api-aat.service.core-compute-aat.internal
SERVICES_PRD_COMMONDATA_API: http://rd-commondata-api-aat.service.core-compute-aat.internal
Expand Down Expand Up @@ -584,7 +585,7 @@ redis:
sscs-hearings-api:
enabled: true
java:
image: "hmctspublic.azurecr.io/sscs/hearings-api:latest" #Change to pr if required
image: "hmctspublic.azurecr.io/sscs/hearings-api:pr-646" #Change to pr if required
releaseNameOverride: ${SERVICE_NAME}-sscs-hearings-api
ingressHost: hearings-${SERVICE_FQDN}
environment:
Expand All @@ -604,7 +605,7 @@ sscs-hearings-api:
#Messaging
HMC_HEARINGS_LISTENING_ENABLED: true
HMC_HEARINGS_TOPIC_NAME: "hmc-to-cft-aat"
HMC_HEARINGS_TOPIC_SUBSCRIPTION_NAME: "hmc-to-sscs-subscription-pr-3973"
HMC_HEARINGS_TOPIC_SUBSCRIPTION_NAME: "hmc-to-sscs-subscription-pr-4056"
TRIBUNALS_HEARINGS_LISTENING_ENABLED: true
TRIBUNALS_EVENT_QUEUE_NAME: ${SERVICE_NAME}-servicebus-tribunals-to-hearing-api
TRIBUNALS_EVENT_QUEUE_POLICY_NAME: RootManageSharedAccessKey
Expand All @@ -615,6 +616,7 @@ sscs-hearings-api:
CORE_CASE_DATA_CASE_TYPE_ID: Benefit-${CHANGE_ID}
HEARINGS_CASE_UPDATE_V2_ENABLED: true
ADJOURNMENT_ENABLED: true
BYPASS_HEARING_API_SERVICE: true
secrets:
TRIBUNALS_EVENT_QUEUE_ACCESS_KEY:
secretRef: sscs-sb-preview
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import java.util.List;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
Expand All @@ -31,7 +30,6 @@
@SpringBootTest
@AutoConfigureMockMvc(addFilters = false)
@ActiveProfiles("integration")
@Disabled("Please remove this line when Hearing api bypass feature flag is true")
class ServiceHearingsControllerTest {

private static final long CASE_ID = 1625080769409918L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,23 @@ public class HearingsJmsConfig {
@Value("${azure.service-bus.hmc-to-hearings-api.idleTimeout}")
private Long idleTimeout;

@Bean
@ConditionalOnProperty({"feature.bypass-hearing-api-service.enabled", "flags.hmc-to-hearings-api.enabled"})
public ConnectionFactory hmcHearingJmsConnectionFactory(@Value("${spring.application.name}") final String clientId) {
@Value("${spring.application.name}")
private String clientId;

private ConnectionFactory hmcHearingJmsConnectionFactory() {
String connection = String.format(AMQP_CONNECTION_STRING_TEMPLATE, namespace + connectionPostfix, idleTimeout);
JmsConnectionFactory jmsConnectionFactory = new JmsConnectionFactory(connection);
jmsConnectionFactory.setUsername(username);
jmsConnectionFactory.setPassword(password);
jmsConnectionFactory.setClientID(clientId);

return new CachingConnectionFactory(jmsConnectionFactory);
}

@Bean
@ConditionalOnProperty({"feature.bypass-hearing-api-service.enabled", "flags.hmc-to-hearings-api.enabled"})
public JmsListenerContainerFactory<DefaultMessageListenerContainer> hmcHearingsEventTopicContainerFactory(
ConnectionFactory hmcHearingJmsConnectionFactory,
DefaultJmsListenerContainerFactoryConfigurer configurer) {
ConnectionFactory hmcHearingJmsConnectionFactory = hmcHearingJmsConnectionFactory();
DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
factory.setConnectionFactory(hmcHearingJmsConnectionFactory);
factory.setReceiveTimeout(receiveTimeout);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ public class TribunalsHearingsJmsConfig {
@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) {
@Value("${spring.application.name}")
private String clientId;

private ConnectionFactory tribunalsHearingsJmsConnectionFactory() {
String connection = String.format(amqpConnectionStringTemplate, namespace + connectionPostfix, idleTimeout);
JmsConnectionFactory jmsConnectionFactory = new JmsConnectionFactory(connection);
jmsConnectionFactory.setUsername(username);
Expand All @@ -53,8 +55,8 @@ public ConnectionFactory tribunalsHearingsJmsConnectionFactory(@Value("${spring.

@Bean
public JmsListenerContainerFactory<DefaultMessageListenerContainer> tribunalsHearingsEventQueueContainerFactory(
ConnectionFactory tribunalsHearingsJmsConnectionFactory,
DefaultJmsListenerContainerFactoryConfigurer defaultJmsListenerContainerFactoryConfigurer) {
ConnectionFactory tribunalsHearingsJmsConnectionFactory = tribunalsHearingsJmsConnectionFactory();
DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
factory.setConnectionFactory(tribunalsHearingsJmsConnectionFactory);
factory.setReceiveTimeout(receiveTimeout);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ public HmcHearingsEventTopicListener(@Value("${sscs.serviceCode}") String sscsSe
)
public void onMessage(JmsBytesMessage message) throws JMSException, HmcEventProcessingException {

if (!isByPassHearingServiceEnabled && isDeploymentFilterEnabled && !isMessageReleventForDeployment(message)) {
log.info("isByPassHearingServiceEnabled && isDeploymentFilterEnabled ------------------------> {}, {}", isByPassHearingServiceEnabled,
isDeploymentFilterEnabled);
if (isDeploymentFilterEnabled && !isMessageReleventForDeployment(message)) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class TribunalsHearingsEventQueueListener {
)
public void handleIncomingMessage(HearingRequest message) throws TribunalsEventProcessingException, GetCaseException, UpdateCaseException {

log.info("isByPassHearingServiceEnabled ------------------------> {}", isByPassHearingServiceEnabled);
if (!isByPassHearingServiceEnabled) {
return;
}
Expand Down

0 comments on commit 8125bbe

Please sign in to comment.