Skip to content

Commit e265616

Browse files
committed
MLE-26325 Added retry support after creating endpoins
1 parent 3f91f02 commit e265616

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

build.gradle

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ subprojects {
1515
repositories {
1616
mavenCentral()
1717

18-
// For pdc-client-api
19-
mavenLocal()
20-
2118
// Temporarily using to depend on marklogic-junit5 snapshot until it's released.
2219
maven {
2320
url = "https://bed-artifactory.bedford.progress.com:443/artifactory/ml-maven-snapshots/"

ml-app-deployer/src/main/java/com/marklogic/appdeployer/command/pdc/DeployMarkLogicEndpointsCommand.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,13 @@ private MarkLogicHttpEndpoint buildEndpointFromFile(CommandContext context, File
115115

116116
private void deployEndpointsByService(CommandContext context, Map<String, List<MarkLogicHttpEndpoint>> endpointsByDnsName) {
117117
final String host = context.getManageClient().getManageConfig().getHost();
118-
try (PdcClient pdcClient = new PdcClient(host, context.getAppConfig().getCloudApiKey())) {
118+
final String apiKey = context.getAppConfig().getCloudApiKey();
119+
120+
PdcClient.Builder clientBuilder = PdcClient.newBuilder(host, apiKey)
121+
// Need retry-on-404 support here due to a possible load balancer restart after endpoint creation.
122+
.retryOn404(5, 1000);
123+
124+
try (PdcClient pdcClient = clientBuilder.build()) {
119125
for (Map.Entry<String, List<MarkLogicHttpEndpoint>> entry : endpointsByDnsName.entrySet()) {
120126
String dnsName = entry.getKey();
121127
List<MarkLogicHttpEndpoint> endpoints = entry.getValue();

0 commit comments

Comments
 (0)