-
Notifications
You must be signed in to change notification settings - Fork 0
Notification Changes for AMP-167 & 168(sync) and AMP-169 #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
74eb626
Notification Changes
srivanimuddineni 54812a1
Refactor Subscriber class with Lombok annotations
srivanimuddineni 3c79368
Test case fix
srivanimuddineni 8ae9b01
removed unnecessary comments
srivanimuddineni 2f6baa4
Resolved review comments
srivanimuddineni 5315962
Reverted docker file to original
srivanimuddineni f8e4490
pmd issues fix
srivanimuddineni 4de50cb
Notification Changes for AMP-167 & 168(sync) and AMP-169 - Incorporte…
srivanimuddineni 3213590
Notification Changes for AMP-167 & 168(sync) and AMP-169 - Incorporte…
srivanimuddineni 68d5b2b
Notification Changes for AMP-167 & 168(sync) and AMP-169 - Incorporte…
srivanimuddineni 9d6c599
Notification Changes for AMP-167 & 168(sync) and AMP-169 - Resolved …
srivanimuddineni c00f7c1
Notification Changes for AMP-167 & 168(sync) & AMP-169 Impl of RestT…
srivanimuddineni 8a140ab
Notification Changes for AMP-167 & 168(sync) & AMP-169 Impl of RestT…
srivanimuddineni 5770001
feature: amp-167 notification changes
coling01 a1584f5
feature: amp-167 notification changes
coling01 7502171
feature: amp-167 notification changes
coling01 1f70708
Merge pull request #32 from hmcts/feature/colin-notification-changes
srivanimuddineni cdb5b41
Notification Changes for AMP-167 & 168(sync) & AMP-169 moved subscrip…
srivanimuddineni bfedef3
Notification Changes for AMP-167 & 168(sync) & AMP-169 moved subscrip…
srivanimuddineni b84fe48
Notification Changes for AMP-167 & 168(sync) & AMP-169 removed readyOnly
srivanimuddineni 0d2397e
Notification Changes for AMP-167 & 168(sync) & AMP-169 Added Manager …
srivanimuddineni File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| // Material API OpenAPI client generation | ||
| tasks.named('compileJava') { | ||
| dependsOn(tasks.openApiGenerate) | ||
| } | ||
|
|
||
| def materialClientOutputDir = "${layout.buildDirectory.get().asFile.absolutePath}/generated" | ||
|
|
||
| openApiGenerate { | ||
| inputSpec = "$rootDir/src/main/resources/openapi/material-api-spec.yml" | ||
| outputDir = materialClientOutputDir | ||
| generatorName = 'java' | ||
| library = 'resttemplate' | ||
| apiPackage = 'uk.gov.hmcts.cp.material.openapi.api' | ||
| modelPackage = 'uk.gov.hmcts.cp.material.openapi.model' | ||
| invokerPackage = 'uk.gov.hmcts.cp.material.openapi' | ||
| typeMappings = ['OffsetDateTime': 'Instant'] | ||
| importMappings = ['java.time.OffsetDateTime': 'java.time.Instant'] | ||
| configOptions = [ | ||
| useSpringBoot4 : 'true', | ||
| useJakartaEe : 'true', | ||
| useTags : 'true', | ||
| openApiNullable : 'false' | ||
| ] | ||
| } | ||
|
|
||
| sourceSets { | ||
| main { | ||
| java { | ||
| srcDir "${materialClientOutputDir}/src/main/java" | ||
| } | ||
| } | ||
| } | ||
|
|
||
| dependencies { | ||
| implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310' | ||
| implementation 'javax.annotation:javax.annotation-api:1.3.2' | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 0 additions & 18 deletions
18
src/main/java/uk/gov/hmcts/cp/subscription/client/DocumentServiceClient.java
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
src/main/java/uk/gov/hmcts/cp/subscription/clients/MaterialClient.java
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
src/main/java/uk/gov/hmcts/cp/subscription/clients/model/MaterialResponse.java
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/uk/gov/hmcts/cp/subscription/config/MaterialApiConfig.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| package uk.gov.hmcts.cp.subscription.config; | ||
|
|
||
| import org.springframework.beans.factory.annotation.Value; | ||
| import org.springframework.context.annotation.Bean; | ||
| import org.springframework.context.annotation.Configuration; | ||
| import org.springframework.web.client.RestTemplate; | ||
| import uk.gov.hmcts.cp.material.openapi.ApiClient; | ||
| import uk.gov.hmcts.cp.material.openapi.api.MaterialApi; | ||
|
|
||
| /** | ||
| * Configures the OpenAPI-generated Material API client with base URL from material-client.url. | ||
| */ | ||
| @Configuration | ||
srivanimuddineni marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| public class MaterialApiConfig { | ||
|
|
||
| @Bean | ||
| public ApiClient materialApiClient( | ||
| @Value("${material-client.url}") final String baseUrl, | ||
| final RestTemplate restTemplate) { | ||
| final ApiClient client = new ApiClient(restTemplate); | ||
| client.setBasePath(baseUrl); | ||
| return client; | ||
| } | ||
|
|
||
| @Bean | ||
| public MaterialApi materialApi(final ApiClient materialApiClient) { | ||
| return new MaterialApi(materialApiClient); | ||
| } | ||
| } | ||
49 changes: 49 additions & 0 deletions
49
src/main/java/uk/gov/hmcts/cp/subscription/config/RetryConfig.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| package uk.gov.hmcts.cp.subscription.config; | ||
|
|
||
| import lombok.Builder; | ||
| import lombok.Value; | ||
| import org.springframework.retry.backoff.ExponentialBackOffPolicy; | ||
| import org.springframework.retry.policy.SimpleRetryPolicy; | ||
| import org.springframework.retry.support.RetryTemplate; | ||
|
|
||
| import java.util.Map; | ||
|
|
||
| /** | ||
| * Common retry configuration for Material API and Callback URL delivery. | ||
| * Supports exponential backoff and configurable retry policies. | ||
| */ | ||
| @Value | ||
| @Builder | ||
| public class RetryConfig { | ||
|
|
||
| int maxAttempts; | ||
| long initialDelayMs; | ||
| double multiplier; | ||
| long maxDelayMs; | ||
|
|
||
| /** | ||
| * Creates a RetryTemplate with exponential backoff that retries on the given exception types. | ||
| */ | ||
| public RetryTemplate toRetryTemplate(final Map<Class<? extends Throwable>, Boolean> retryableExceptions) { | ||
srivanimuddineni marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| final SimpleRetryPolicy retryPolicy = new SimpleRetryPolicy(maxAttempts, retryableExceptions); | ||
| final ExponentialBackOffPolicy backOffPolicy = new ExponentialBackOffPolicy(); | ||
| backOffPolicy.setInitialInterval(initialDelayMs); | ||
| backOffPolicy.setMultiplier(multiplier); | ||
| backOffPolicy.setMaxInterval(maxDelayMs); | ||
|
|
||
| final RetryTemplate template = new RetryTemplate(); | ||
| template.setRetryPolicy(retryPolicy); | ||
| template.setBackOffPolicy(backOffPolicy); | ||
| return template; | ||
| } | ||
|
|
||
| /** Generic default: 3 attempts, 50ms initial, multiplier 2, max 5000ms. */ | ||
| public static RetryConfig retryConfig() { | ||
srivanimuddineni marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| return RetryConfig.builder() | ||
| .maxAttempts(3) | ||
| .initialDelayMs(50) | ||
| .multiplier(2) | ||
| .maxDelayMs(5000) | ||
| .build(); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.