Skip to content

RaiseEventAsync with a given taskhubname is missing compared to in process #298

Description

@jcageman

In the non isolated worker model you could trigger an orchestration instance from a different taskhub like so:

Task RaiseEventAsync(string taskHubName, string instanceId, string eventName, object eventData, string connectionName = null);
See: https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.webjobs.durableorchestrationclientbase.raiseeventasync?view=azure-dotnet-legacy#microsoft-azure-webjobs-durableorchestrationclientbase-raiseeventasync(system-string-system-string-system-string-system-object-system-string)

I currently don't see any way to do that currently. Also an option to create a new DurableTaskClient dynamically for a different taskhub is not trivial as far as I can see?

    [Function(nameof(WebhookHttpTrigger))]
    public async Task<HttpResponseMessage> RunAsync([HttpTrigger(AuthorizationLevel.Anonymous, "POST", Route = "MyWebhook/{taskHubName}/{orchestrationId}/{requestId}")] HttpRequestMessage req,
        [DurableClient] DurableTaskClient client,
        string taskHubName,
        ILogger logger)

I would like to create a DurableClient with the taskHubName parameter given in the http route or RaiseEventAsync with a taskhubname as we could do in the non-isolated case. As far as i can find the only option is building a custom binder? Using binder as in Azure/azure-functions-dotnet-worker#1106 (comment) is also not possible in isolated.

Activity

  1. jviau commented on Apr 25, 2024

    @jviau
    Member

    jcageman can you try getting a client with the name provided:

    [DurableClient(TaskHub = "hubname")]
  2. jcageman commented on Apr 26, 2024

    @jcageman
    Author

    jcageman can you try getting a client with the name provided:

    [DurableClient(TaskHub = "hubname")]

    as you can see in the example the name of the hub is coming from the http call itself, hence i cannot hardcode the hubname, i need to use the query parameter. The only workaround i see is putting this message on a queue per taskhub and let every taskhub read from it's own queue.

  3. jviau commented on Apr 26, 2024

    @jviau
    Member

    Ah I see. Unfortunately, we won't be adding that overload you are asking for. Instead, we will need to evaluate a way to allow dynamically retrieving a client for the requested task-hub.

  4. jcageman commented on May 3, 2024

    @jcageman
    Author

    That sounds fine as well!

  5. jonnyguo1988 commented on Dec 11, 2025

    @jonnyguo1988

    Ah I see. Unfortunately, we won't be adding that overload you are asking for. Instead, we will need to evaluate a way to allow dynamically retrieving a client for the requested task-hub.

    Jacob Viau (@jviau) This sound great. Could you please let me know if it is ongoing or already in the field? Thanks so much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions