cadence-java-client icon indicating copy to clipboard operation
cadence-java-client copied to clipboard

Implement Spring integration

Open khaale opened this issue 6 years ago • 13 comments

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:

  1. Enabling - ensure the ability to have custom workers/activities, probably stubs.
  2. Infrastructure - integrate configuration/logging/metrics and other non-functional capabilities of Spring ecosystem.
  3. Starter - add spring-boot autoconfiguration module for Cadence

khaale avatar Jul 29 '19 20:07 khaale

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

szaluzhskiy avatar Aug 01 '19 12:08 szaluzhskiy

We're going to start implementation in fork, so will send PR with results

szaluzhskiy avatar Aug 01 '19 12:08 szaluzhskiy

I'd also think about custom Spring scope per workflow or activity execution.

khaale avatar Aug 02 '19 12:08 khaale

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...

szaluzhskiy avatar Aug 06 '19 16:08 szaluzhskiy

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.

mfateev avatar Aug 06 '19 17:08 mfateev

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

szaluzhskiy avatar Aug 06 '19 17:08 szaluzhskiy

  1. 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
  2. But this option requires some changes on cadence client side - https://github.com/uber/cadence-java-client/pull/357

szaluzhskiy avatar Aug 09 '19 20:08 szaluzhskiy

#357 approved

mfateev avatar Aug 09 '19 21:08 mfateev

@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 avatar Feb 12 '20 10:02 leyonh

@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.

szaluzhskiy avatar Feb 12 '20 21:02 szaluzhskiy

sounds sweet.

leyonh avatar Feb 13 '20 16:02 leyonh

just reviving an old thread. @szaluzhskiy do we still not have spring integration ?

rishabhgpt avatar Oct 15 '22 03:10 rishabhgpt

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

longquanzheng avatar Oct 15 '22 04:10 longquanzheng