Azure / Azure/durabletask

ExtensionData in OrchestrationInstanceEx can share between OrchestrationDispatcherMiddleware but not ActivityDispatcherMiddleware

Open
#622 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
1.7k
Forks
335
Avg merge
2d 23h
Merged PRs (30d)
6

Description

According #503, I think we can share session data between Orchestration and Activity. But my test did not meet expectations. My expected result is `customInstance` in every middle can share the `Dic` data. The test project is [here ](https://github.com/ChenglongLiu/durabletaskTest/tree/master/UseAzuriteTest/SessionDataTest).

`

taskHub.AddOrchestrationDispatcherMiddleware(async (context, next) =>
{
OrchestrationRuntimeState runtimeState = context.GetProperty();
var customInstance = OrchestrationInstanceEx.Initialize(runtimeState);
customInstance.Dic["a"] = "a";
customInstance.Dic["b"] = "b";
customInstance.Dic["c"] = "c";
context.SetProperty(customInstance);
await next();
});

taskHub.AddOrchestrationDispatcherMiddleware(async (context, next) =>
{
var customInstance = OrchestrationInstanceEx.Get(context.GetProperty());
context.SetProperty(customInstance);

//Dic data can get here. But missed in HelloOrchestration context and ActivityDispatcherMiddleware

await next();
});

taskHub.AddActivityDispatcherMiddleware(async (context, next) =>
{
var customInstance = OrchestrationInstanceEx.Get(context.GetProperty());
context.SetProperty(customInstance);

//Dic data can missed here

await next();
});
`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.