microsoft / durabletask-java

Java SDK for Durable Functions and the Durable Task Framework
MIT License
13 stars 7 forks source link

Typed proxy support #13

Open cgillum opened 2 years ago

cgillum commented 2 years ago

Requirements

In order to create a type-safe experience for working with orchestrations and activities, the Java SDK for the Durable Task Framework should support type-safe invocation of orchestration and activities.

For example, when calling an activity, instead of the following:

Object activityInput = "World";
String result = context.callActivity("SayHello", activityInput, String.class).get();

...we should be able to instead write:

MyActivities activities = // get a pointer to an activity proxy
String result = activities.sayHello("World");

We'd want the same experience also for orchestrations (created by a client) and sub-orchestrations.

Ideally this support will also allow developers to easily unit test their code.

Design considerations

Java's Proxy support could be a good starting point for such a feature.

kamperiadis commented 1 year ago

I'll start looking at our options for this