Hi
I’m looking a way to call @QueryMethod of one workflow from another. I’ve note from here Cannot call @QueryMethod from child workflow that I need to querying from Activity and use WorkflowClient to get workflowStub.
public String someActivityMethod(String workflowId, String queryType) {
WorkflowServiceStubs service = WorkflowServiceStubs.newInstance();
WorkflowClient client = WorkflowClient.newInstance(service);
WorkflowStub workflow = client.newUntypedWorkflowStub(workflowId);
return workflow.query(queryType, String.class);
}
But in this case I’m getting error
io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:262)
io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:243)
io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:156)
io.grpc.health.v1.HealthGrpc$HealthBlockingStub.check(HealthGrpc.java:252)
io.temporal.serviceclient.WorkflowServiceStubsImpl.lambda$checkHealth$2(WorkflowServiceStubsImpl.java:273)
io.temporal.internal.retryer.GrpcSyncRetryer.retry(GrpcSyncRetryer.java:61)
io.temporal.internal.retryer.GrpcRetryer.retryWithResult(GrpcRetryer.java:51)
io.temporal.serviceclient.WorkflowServiceStubsImpl.checkHealth(WorkflowServiceStubsImpl.java:266)
io.temporal.serviceclient.WorkflowServiceStubsImpl.<init>(WorkflowServiceStubsImpl.java:173)
io.temporal.serviceclient.WorkflowServiceStubs.newInstance(WorkflowServiceStubs.java:51)
io.temporal.serviceclient.WorkflowServiceStubs.newInstance(WorkflowServiceStubs.java:41)
io.temporal.serviceclient.WorkflowServiceStubs.newInstance(WorkflowServiceStubs.java:36)
Help me please, how can i get workflowStub in activity or sugest another way to call @QueryMethod from workflow.