1

I started with Amazon's Java-based HelloWorldWorkflowDistributed example and I'm adding to it little by little to achieve what we want. I have added a second activity worker, but the two activities are receiving each other's tasks and no tasks are getting accomplished. Can anyone point me to a COMPLETE, WORKING example of a workflow that calls out to two or more distinct workers?
E.g. the following error appears in the console where BarActivities.getName is running, and vice versa:

Aug 26, 2016 2:15:24 PM com.amazonaws.services.simpleworkflow.flow.worker.SynchronousActivityTaskPoller execute
SEVERE: Failure processing activity task with taskId=10, workflowGenerationId=id_for_107, activity={Name: FooActivities.getAddress,Version: 1.0.7}, activityInstanceId=1
com.amazonaws.services.simpleworkflow.flow.ActivityFailureException: Unknown activity type: {Name: FooActivities.getAddress,Version: 1.0.7} : null
    at com.amazonaws.services.simpleworkflow.flow.worker.SynchronousActivityTaskPoller.execute(SynchronousActivityTaskPoller.java:194)
    at com.amazonaws.services.simpleworkflow.flow.worker.ActivityTaskPoller$2.run(ActivityTaskPoller.java:92)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Arafat Nalkhande
  • 11,078
  • 9
  • 39
  • 63
MartinThurn
  • 327
  • 1
  • 3
  • 13

1 Answers1

0

Activity workers poll for activity tasks using task lists. I believe you added a new worker without using a separate task list for its activities. As both workers share the same task list they end up sometimes receiving tasks for activities that they don't support which results in the "Unknown activity type" exception. The solution is to use a different task list for each worker.

Maxim Fateev
  • 6,458
  • 3
  • 20
  • 35
  • 1
    Ah yes that is working now. Thank you. I thought I had already tried that and it failed as if no workers were getting any tasks, but something else must have been going wrong. – MartinThurn Aug 29 '16 at 12:32