Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I register a microservice (or its methods) to Task in Netflix Conductor?

I was looking for a more sophisticated workflow than Saga from AxonFramework -- which we are currently using -- and I found one in Netflix Conductor. Sadly, I have searched the Internet for a decent example but to no avail.

My question is, in Netflix Conductor, how might one define and create Task or WorkflowTask and most importantly, link a microservice to it? Here is a Netflix Conductor code from github:

    WorkflowDef def = new WorkflowDef();
    def.setName("test");
    WorkflowTask t0 = new WorkflowTask();
    t0.setName("t0");
    t0.setType(Type.SIMPLE);
    t0.setTaskReferenceName("t0");

    WorkflowTask t1 = new WorkflowTask();
    t1.setName("t1");
    t1.setType(Type.SIMPLE);
    t1.setTaskReferenceName("t1");

    def.getTasks().add(t0);
    def.getTasks().add(t1);

Pardon my confusion as I am new to Netflix Conductor.

like image 716
ben.jamin Avatar asked Jan 27 '17 21:01

ben.jamin


People also ask

What is conductor in microservices?

In a microservices world, a lot of business process automations are driven by orchestrating across services. Conductor enables orchestration across services while providing control and visibility into their interactions.

Is Netflix conductor free?

Conductor is a free and open-source microservice orchestration software platform originally developed by Netflix.

What is the use of Netflix conductor?

Conductor is a platform created by Netflix to orchestrate workflows that span across microservices. Apache-2.0 license for commercial and non-commerical use. Freedom to deploy, modify and contribute back. A fully abstracted backend enables you choose your own database persistence layer and queueing service.

What is conductor workflow?

Conductor is a workflow server built upon Workflow Core that enables you to coordinate multiple services and scripts into workflows so that you can rapidly create complex workflow applications. Workflows are made up of a series of steps, with an internal data object shared between them to pass information around.


1 Answers

Assuming the Micro service has a REST Endpoint over HTTP. In that case you've to use HttpTask which is a system task. Httptask makes a Http call and the response is available as task output. Pls refer to the below link:HttpTask

Pls remember to set the SchemaVersion as 2 for the WorkflowDef which contains HttpTask. You would also need a corresponding Task type registered.

like image 112
Smbk Avatar answered Oct 19 '22 20:10

Smbk