Azure / Azure/durabletask

Easy way to set DataConverter for entire orchestration?

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

Description

Hello!

I was using a custom struct as an input and return value throughout one of my orchestrations, and I spotted problems with the value transferring between the orchestrations and the tasks. I realised the struct probably wasn't playing ball with JSON.NET, so found a constructor on TaskHubClient that accepted a `DataConverter` that I could pass a `JsonDataConverter` to with custom serialization settings, and custom `JsonConverter`s - hurrah!

I was surprised that this only affected the conversion of the initial inputs to the orchestration and not the conversion between the orchestration, suborchestrations, and tasks.

I found another `DataConverter` on the `OrchestrationContext`, and another on the `TaskOrchestration` itself, and one on the `AsyncTaskActivity` class - that's quite a few, and I'm sure there are benefits to them all using their own `DataConverters`, but is there an easy way to specify a default `DataConverter` that gets used across an entire orchestration instance (and maybe all orchestration instances)? I might very well be missing an easy way to do this, I confess!

Thanks!

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.