We definitely need to write such a sample. In the meantime, you have to do it yourself.
- Make sure that both Java and Go workers share the same domain (this is not a hard requirement, but simplifies things).
- Make sure that Go and Java workers are using different task queue names to route tasks appropriately.
- You can either create Java activities interface that mirrors Go activities signatures or use non strongly typed ActivityStub interface to invoke them directly by name.
- When initializing activity stub pass Go task queue name to it as an option.
Something like:
ActivityOptions options =
ActivityOptions.newBuilder()
.setTaskQueue(GO_ACTIVITIES)
.setStartToCloseTimeout(Duration.ofSeconds(20))
.build();
ActivityStub goActivities = Workflow.newUntypedActivityStub(options);
String result = goActivities.execute("MyGoActivity1", String.class, arg1, arg2);