webber
webber

Reputation: 1896

AWS SWF: Running activities on different servers

I have a workflow with >3 activities running on 2 servers, but I want one of the activities to run on a 3rd dedicated server i.e. this server should only execute activity x and not the entire workflow. So far (with my limited knowledge) I could make a service call in the activity to execute the process on the dedicated server and then receive a callback when it's done, but I have a feeling there must be an easier way to it.

Has anyone tried this ever?

Upvotes: 1

Views: 276

Answers (1)

Maxim Fateev
Maxim Fateev

Reputation: 6890

Activity and workflow tasks are delivered through task lists. By default activity is scheduled on a default task list associated to the activity type. You have to a use a different task list for the third activity and make sure that its activity worker polls on that task list.

If you are using AWS Flow Framework for Java then you can do it through the following annotation:

@Activities
@ActivityRegistrationOptions(...) // used by activity1 and activity2
public interface MyActivities {
   public void activity1();

   public void activity2();

   // override for activity3
   @ActivityRegistrationOptions(defaultTaskList="activity3", ...) 
   public void activity3();

}

Then use "activity3" as taskListToPoll constructor parameter for activity3 ActivityWorker.

Upvotes: 4

Related Questions