如何解决Google长期运行状态检查问题
我已提交google batchTranslation并获得了operationId(项目// locations / us-central1 / operations /)。
现在我想通过合并检查此操作的状态。在这里我使用了以下依赖项
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax-grpc</artifactId>
<version>1.58.2</version>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax</artifactId>
<version>1.58.2</version>
</dependency>
在Java类中添加了以下代码:
GoogleCredentials credentials = GoogleCredentials
.fromStream(new ByteArrayInputStream(serviceKey.getBytes()))
.createScoped(Lists.newArrayList("https://clicktime.symantec.com/3TWFMHceuuMgwf8KebwWinm7Vc?u=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform%2522%29%29%3B
OperationsSettings operationsSettings = OperationsSettings.newBuilder().setCredentialsProvider(FixedCredentialsProvider.create(credentials)).build();
OperationsClient operationsClient = OperationsClient.create(operationsSettings);
但是在这里,当我尝试创建OperationsClient时会出现nullpointerException
at com.google.longrunning.stub.OperationsStubSettings.createStub(OperationsStubSettings.java:107)
at com.google.longrunning.OperationsClient.<init>(OperationsClient.java:143)
at com.google.longrunning.OperationsClient.create(OperationsClient.java:125)
进一步调查发现,创建的OperationsSettings的transportChannelProvider为null。
请指导我,在创建OperationSettings / OperationClient时是否丢失了某些内容? 在Java中查找Google长期运行状态的最佳方法是什么。
谢谢, 兰吉特·库玛(Ranjit Kumar)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。