Skip to content

Commit ed651fd

Browse files
Remove idempotency retain period from ingress client options. (#268)
1 parent 47571b5 commit ed651fd

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

sdk-common/src/main/java/dev/restate/sdk/client/DefaultIngressClient.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,6 @@ private <Req> HttpRequest prepareHttpRequest(
192192
if (options.getIdempotencyKey() != null) {
193193
reqBuilder.header("idempotency-key", options.getIdempotencyKey());
194194
}
195-
if (options.getIdempotencyRetainPeriod() != null) {
196-
reqBuilder.header(
197-
"idempotency-retention-period",
198-
String.valueOf(options.getIdempotencyRetainPeriod().toSeconds()));
199-
}
200195

201196
// Add additional headers
202197
options.getAdditionalHeaders().forEach(reqBuilder::header);

sdk-common/src/main/java/dev/restate/sdk/client/RequestOptions.java

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// https://github.com/restatedev/sdk-java/blob/main/LICENSE
99
package dev.restate.sdk.client;
1010

11-
import java.time.Duration;
1211
import java.util.HashMap;
1312
import java.util.Map;
1413
import java.util.Objects;
@@ -18,20 +17,13 @@ public class RequestOptions {
1817
public static final RequestOptions DEFAULT = new RequestOptions();
1918

2019
private String idempotencyKey;
21-
private Duration idempotencyRetainPeriod;
2220
private final Map<String, String> additionalHeaders = new HashMap<>();
2321

2422
public RequestOptions withIdempotency(String idempotencyKey) {
2523
this.idempotencyKey = idempotencyKey;
2624
return this;
2725
}
2826

29-
public RequestOptions withIdempotency(String idempotencyKey, Duration idempotencyRetainPeriod) {
30-
this.idempotencyKey = idempotencyKey;
31-
this.idempotencyRetainPeriod = idempotencyRetainPeriod;
32-
return this;
33-
}
34-
3527
public RequestOptions withHeader(String name, String value) {
3628
this.additionalHeaders.put(name, value);
3729
return this;
@@ -46,10 +38,6 @@ public String getIdempotencyKey() {
4638
return idempotencyKey;
4739
}
4840

49-
public Duration getIdempotencyRetainPeriod() {
50-
return idempotencyRetainPeriod;
51-
}
52-
5341
public Map<String, String> getAdditionalHeaders() {
5442
return additionalHeaders;
5543
}
@@ -62,16 +50,13 @@ public boolean equals(Object o) {
6250
RequestOptions that = (RequestOptions) o;
6351

6452
if (!Objects.equals(idempotencyKey, that.idempotencyKey)) return false;
65-
if (!Objects.equals(idempotencyRetainPeriod, that.idempotencyRetainPeriod)) return false;
66-
return Objects.equals(additionalHeaders, that.additionalHeaders);
53+
return additionalHeaders.equals(that.additionalHeaders);
6754
}
6855

6956
@Override
7057
public int hashCode() {
7158
int result = idempotencyKey != null ? idempotencyKey.hashCode() : 0;
72-
result =
73-
31 * result + (idempotencyRetainPeriod != null ? idempotencyRetainPeriod.hashCode() : 0);
74-
result = 31 * result + (additionalHeaders != null ? additionalHeaders.hashCode() : 0);
59+
result = 31 * result + additionalHeaders.hashCode();
7560
return result;
7661
}
7762

@@ -81,8 +66,6 @@ public String toString() {
8166
+ "idempotencyKey='"
8267
+ idempotencyKey
8368
+ '\''
84-
+ ", idempotencyRetainPeriod="
85-
+ idempotencyRetainPeriod
8669
+ ", additionalHeaders="
8770
+ additionalHeaders
8871
+ '}';

0 commit comments

Comments
 (0)