File tree Expand file tree Collapse file tree 3 files changed +12
-6
lines changed
src/main/java/io/eigr/spawn/internal/client Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ The second thing we have to do is add the spawn dependency to the project.
9090<dependency >
9191 <groupId >com.github.eigr</groupId >
9292 <artifactId >spawn-java-std-sdk</artifactId >
93- <version >v0.3.5 </version >
93+ <version >v0.4.1 </version >
9494</dependency >
9595```
9696We're also going to configure a few things for our application build to work, including compiling the protobuf files.
@@ -124,7 +124,7 @@ See below a full example of the pom.xml file:
124124 <dependency >
125125 <groupId >com.github.eigr</groupId >
126126 <artifactId >spawn-java-std-sdk</artifactId >
127- <version >v0.3.5 </version >
127+ <version >v0.4.1 </version >
128128 </dependency >
129129 <dependency >
130130 <groupId >ch.qos.logback</groupId >
Original file line number Diff line number Diff line change 44 <groupId >io.eigr.spawn</groupId >
55 <artifactId >spawn-java-std-sdk</artifactId >
66 <packaging >jar</packaging >
7- <version >0.3.5 </version >
7+ <version >0.4.1 </version >
88 <name >spawn-java-std-sdk</name >
99 <url >http://maven.apache.org</url >
1010
Original file line number Diff line number Diff line change 66import org .slf4j .LoggerFactory ;
77
88import java .util .Objects ;
9+ import java .util .concurrent .TimeUnit ;
910
1011public final class OkHttpSpawnClient implements SpawnClient {
1112 private static final Logger log = LoggerFactory .getLogger (OkHttpSpawnClient .class );
@@ -20,13 +21,18 @@ public final class OkHttpSpawnClient implements SpawnClient {
2021 private final int proxyPort ;
2122 private final OkHttpClient client ;
2223
23- //private SpawnProperties properties;
24-
2524 public OkHttpSpawnClient (String system , String proxyHost , int proxyPort ) {
2625 this .system = system ;
2726 this .proxyHost = proxyHost ;
2827 this .proxyPort = proxyPort ;
29- this .client = new OkHttpClient ();
28+ this .client = new OkHttpClient .Builder ()
29+ .connectTimeout (30 , TimeUnit .SECONDS )
30+ .readTimeout (30 , TimeUnit .SECONDS )
31+ .writeTimeout (30 , TimeUnit .SECONDS )
32+ .callTimeout (100 , TimeUnit .SECONDS )
33+ .retryOnConnectionFailure (true )
34+ .connectionPool (new ConnectionPool (256 , 100 , TimeUnit .SECONDS ))
35+ .build ();
3036 }
3137
3238 @ Override
You can’t perform that action at this time.
0 commit comments