Implement Spring integration
It would be nice to have Cadence as a member of a huge Spring ecosystem. I'd suggest the following roadmap as a starting point for discussion:
- Enabling - ensure the ability to have custom workers/activities, probably stubs.
- Infrastructure - integrate configuration/logging/metrics and other non-functional capabilities of Spring ecosystem.
- Starter - add spring-boot autoconfiguration module for Cadence
As a first step I think Workflow and what is more important Activity need to integrated to Spring. And then we need to make them available via starter and autoconfiguration
We're going to start implementation in fork, so will send PR with results
I'd also think about custom Spring scope per workflow or activity execution.
Please evaluate option 1. https://github.com/szaluzhskiy/cadence-java-client-starter/pull/1 This is a way to make Workflow stub without any changes in Cadence client code
Option 2. Added new method to workflowClient.newWorkflowStub where as args provide Factory which will create Prototype scoped spring bean of Workflow. But this requires changes on Cadence client side...
It would be nice to keep all the spring integration is a separate package and ideally in a separate maven library. I'm not sure how to build multiple libraries with gradle from a single git repo.
Sure, usually spring starter is a separate library which is intended to make additional spring automation around one or several components in backend. Of cause it can be done under maven or gradle
- Please review improved starter - https://github.com/szaluzhskiy/cadence-java-client-starter/tree/forReviewByCadenceTeam this option of starter has next benifits: No AOP around workflow, workflow are prototype scoped
- But this option requires some changes on cadence client side - https://github.com/uber/cadence-java-client/pull/357
#357 approved
@szaluzhskiy Hi, I am trying to implement workflow based on spring boot. what's status for spring integration ? With #357 merged, did you go with option 1 or option 2 ? Thx.
@leyonh Hi, actually nothing new, but my team is going speed up Spring integration. One main reason is that we are suffer from absence of declarative transaction support ( @Transaction annotation) when non-Spring activity is used.
sounds sweet.
just reviving an old thread. @szaluzhskiy do we still not have spring integration ?
The 3.x version should work for spring and I have been using it with spring
On Fri, Oct 14, 2022 at 8:30 PM Rishabh Gupta @.***> wrote:
just reviving an old thread. @szaluzhskiy https://github.com/szaluzhskiy do we still not have spring integration ?
— Reply to this email directly, view it on GitHub https://github.com/uber/cadence-java-client/issues/351#issuecomment-1279646595, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCQPMZW3NXW73PMVGEOK3DWDIQPBANCNFSM4IHWBUCA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
--
Thanks, Quanzheng