-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathRestateHttpServerProperties.java
More file actions
46 lines (40 loc) · 1.75 KB
/
RestateHttpServerProperties.java
File metadata and controls
46 lines (40 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright (c) 2023 - Restate Software, Inc., Restate GmbH
//
// This file is part of the Restate Java SDK,
// which is released under the MIT license.
//
// You can find a copy of the license in file LICENSE in the root
// directory of this repository or package, or at
// https://github.com/restatedev/sdk-java/blob/main/LICENSE
package dev.restate.sdk.springboot;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.bind.ConstructorBinding;
import org.springframework.boot.context.properties.bind.DefaultValue;
import org.springframework.boot.context.properties.bind.Name;
@ConfigurationProperties(prefix = "restate.sdk.http")
public class RestateHttpServerProperties {
private final int port;
private final boolean disableBidirectionalStreaming;
@ConstructorBinding
public RestateHttpServerProperties(
@Name("port") @DefaultValue(value = "9080") int port,
@Name("disableBidirectionalStreaming") @DefaultValue(value = "false")
boolean disableBidirectionalStreaming) {
this.port = port;
this.disableBidirectionalStreaming = disableBidirectionalStreaming;
}
/** Port to expose the HTTP server. */
public int getPort() {
return port;
}
/**
* If true, disable bidirectional streaming with HTTP/2 requests. Restate initiates for each
* invocation a bidirectional streaming using HTTP/2 between restate-server and the SDK. In some
* network setups, for example when using a load balancers that buffer request/response,
* bidirectional streaming will not work correctly. Only in these scenarios, we suggest disabling
* bidirectional streaming.
*/
public boolean isDisableBidirectionalStreaming() {
return disableBidirectionalStreaming;
}
}