Temporal constructs as a library


I have a usecase where multiple microservices(Java) are going to host different kinds of workflows/activities. I am thinking of building some library which is going to have the common stuff of building WorkflowServiceStubs, WorkflowClient and WorkerFactory by registering them as Beans. All these microservices will have a dependency on that common library and should be able to provide some custom configurations like Namespace/TaskQueue etc. Has anybody implemented in such a fashion? Would like to understand if this is the right approach to do so. Also, is there a sample you can point me at?

Building a library for this is imo perfectly ok. There are some projects that have implemented such things for example this spring boot starter project (we are planning to provide a spring boot starter in future as well), or this Quarkus demo where you can utilize framework features to define things like namespaces and task queue names via application properties.

Temporal SDKs are very unintrusive when it comes to integration with different frameworks so building a helper library should not be something too difficult and I agree pretty useful for reusability between multiple apps/services.


@tihomir Thanks for the confirmation. Will go ahead with this approach.