kymr / conductor

Conductor is a microservices orchestration engine - https://netflix.github.io/conductor/
Apache License 2.0
0 stars 0 forks source link

Summary - Task Domains #16

Closed kymr closed 6 years ago

kymr commented 6 years ago

Link

kymr commented 6 years ago

Task Domains

kymr commented 6 years ago

How to use Task Domains

Change the poll call

Java Client

REST call

GET /tasks/poll/batch/T2?workerid=myworker&domain=mydomain GET /tasks/poll/T2?workerid=myworker&domain=mydomain

Change the start workflow call

Java Client

    Map<String, Object> input = new HashMap<>();
    input.put("wf_input1", "one”);

    Map<String, String> taskToDomain = new HashMap<>();
    taskToDomain.put("T2", "mydomain");

    // Other options ...
    // taskToDomain.put("*", "mydomain") will put all tasks in mydomain
    // taskToDomain.put("T2", "mydomain,fallbackDomain") If mydomain has no active workers
    //        for T2 then will be put in fallbackDomain. Same can be used with "*" too.

    StartWorkflowRequest swr = new StartWorkflowRequest();
    swr.withName(“myWorkflow”)
        .withCorrelationId(“corr1”)
        .withVersion(1)
        .withInput(input)
        .withTaskToDomain(taskToDomain);

    wfclient.startWorkflow(swr);

REST call