Skip to content

Commit

Permalink
merge down java retries change (#1058)
Browse files Browse the repository at this point in the history
  • Loading branch information
danoswaltCL authored Nov 20, 2023
1 parent 19d6f76 commit 553d0cb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions clientlibs/java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
at the same time that happen to rev to the same new version will be caught
by a merge conflict. -->

<!-- 4.1.12 -> 4.1.13: make 'status' a string in mark payload -->
<!-- 4.1.13 -> 4.1.14: no retries for 4xx, retry other errors once instead of 3 times -->

<version>4.1.13</version>
<version>4.1.14</version>
<build>
<plugins>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import javax.ws.rs.core.Response;

import static javax.ws.rs.core.Response.Status.Family.SUCCESSFUL;
import static javax.ws.rs.core.Response.Status.Family.CLIENT_ERROR;

public class PublishingRetryCallback<T> implements InvocationCallback<Response> {

Expand Down Expand Up @@ -35,7 +36,10 @@ public PublishingRetryCallback(AsyncInvoker invoker, Entity<T> message, int retr

@Override
public void completed(Response response) {
if (SUCCESSFUL.equals(response.getStatusInfo().getFamily()) || retries <= 0) {
boolean isSuccess = SUCCESSFUL.equals(response.getStatusInfo().getFamily());
boolean isClientRequestError = CLIENT_ERROR.equals(response.getStatusInfo().getFamily());

if (isSuccess || isClientRequestError || retries <= 0) {
callback.completed(response);
} else {
retry();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class Utils

public static final String PATCH = "PATCH";

public static final int MAX_RETRIES = 3;
public static final int MAX_RETRIES = 1;


public static enum RequestType {
Expand Down

0 comments on commit 553d0cb

Please sign in to comment.