💥 Use ActivitySerializationContext when starting and getting result of Standalone Activity - #3063
maciejdudko wants to merge 6 commits into
Conversation
…Standalone Activity
| throws TimeoutException { | ||
| String namespace = clientOptions.getNamespace(); | ||
| DataConverter dc = clientOptions.getDataConverter(); | ||
| DataConverter dc = |
There was a problem hiding this comment.
Hmm, technically here we can know the task queue if the handle was created by a start or execute call and we would often know the type if the user created the handle with the typed API
There was a problem hiding this comment.
Standalone Activities can have task queue changed after start. Really we should deprecate task queue in serialization context altogether.
There was a problem hiding this comment.
I think there is some value in task queue since users can have different data converters on different task queues so I wouldn't want to deprecate it IMO, but I can understand not wanting to assume it.
| * queue is unknown when getting a Standalone Activity result. | ||
| * @param local {@code true} if this is a local activity | ||
| */ | ||
| public ActivitySerializationContext( |
There was a problem hiding this comment.
Interesting we don't have activity ID here 🤔
|
Shouldn't we have at least one test to show starting a Standalone activity uses the context? |
There was a problem hiding this comment.
Does the async path need to change too?
| DataConverter dc = | |
| clientOptions | |
| .getDataConverter() | |
| .withContext( | |
| new ActivitySerializationContext( | |
| clientOptions.getNamespace(), null, null, null, null, false)); |
There was a problem hiding this comment.
Yes, good find! Fixed.
💥 BREAKING CHANGE
ActivitySerializationContext.activityTypeandactivityTaskQueueare now@Nullablebecause they are unavailable when fetching result.What was changed
ActivitySerializationContexttoDataConverterused for de/serialization of payloads inActivityClient.startandActivityHandle.getResult.ActivitySerializationContext.activityTypeandactivityTaskQueueto@Nullable.Why?
Makes it possible to use context-aware data converters with Standalone Activities.