We recently started using Temporal Cloud and we are mostly a Java house using Spring.
I am creating some base libraries to facilitate integration between the Temporal SDK and Spring. I am also creating blueprints of how code should be structured and shared among different services libraries.
The bit I am struggling with is how to contract neatly the taskQueue name between a service starting a Workflow and the Worker hosting it. Is there some best practice other than hardcoding the value?
You can think about a task queue as “endpoint name” of a worker that hosts the workflow. So hardcoding makes sense unless you plan to use task queue names to support more complex scenarios like versioning.
However, I am leaning towards handling versioning with backward compatible implementations through the versioning API. Since a change in the implementation would be transparent interface-wise, so the caller would have no idea of that happening.
In the case, the interface changes, I would create a new interface altogether since it’s basically a new contract.