Skip to content

Commit 5115aa5

Browse files
gguusslesv
authored andcommitted
Updates translate lib version and changes retryParams to defaults. (#591)
1 parent e75cafb commit 5115aa5

File tree

3 files changed

+3
-21
lines changed

3 files changed

+3
-21
lines changed

translate/cloud-client/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<dependency>
3838
<groupId>com.google.cloud</groupId>
3939
<artifactId>google-cloud-translate</artifactId>
40-
<version>0.8.0</version>
40+
<version>0.11.1-beta</version>
4141
</dependency>
4242

4343
<!-- Test dependencies -->

translate/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ limitations under the License.
3838
<dependency>
3939
<groupId>com.google.cloud</groupId>
4040
<artifactId>google-cloud-translate</artifactId>
41-
<version>0.8.0</version>
41+
<version>0.11.1-beta</version>
4242
</dependency>
4343
<dependency>
4444
<groupId>junit</groupId>

translate/src/main/java/com/example/cloud/translate/samples/TranslateText.java

+1-19
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.example.cloud.translate.samples;
1818

19-
import com.google.cloud.RetryParams;
2019
import com.google.cloud.translate.Detection;
2120
import com.google.cloud.translate.Language;
2221
import com.google.cloud.translate.Translate;
@@ -134,24 +133,7 @@ public static void displaySupportedLanguages(PrintStream out, Optional<String> t
134133
* @return Google Translate Service
135134
*/
136135
public static Translate createTranslateService() {
137-
TranslateOptions translateOption = TranslateOptions.newBuilder()
138-
.setRetryParams(retryParams())
139-
.setConnectTimeout(60000)
140-
.setReadTimeout(60000)
141-
.build();
142-
return translateOption.getService();
143-
}
144-
145-
/**
146-
* Retry params for the Translate API.
147-
*/
148-
private static RetryParams retryParams() {
149-
return RetryParams.newBuilder()
150-
.setRetryMaxAttempts(3)
151-
.setMaxRetryDelayMillis(30000)
152-
.setTotalRetryPeriodMillis(120000)
153-
.setInitialRetryDelayMillis(250)
154-
.build();
136+
return TranslateOptions.newBuilder().build().getService();
155137
}
156138

157139
public static void main(String[] args) {

0 commit comments

Comments
 (0)