amazon web services - AWS SWF Java: Activity returns value but promise never becomes ready -


i have unusual issue think, , i'm looking debugging help.

problems:

  1. even though aws swf console shows activity returned valid response, flow framework never marks promise ready! e.g. in below code "activities.nexttask" never scheduled execution.

  2. the time "activities.nexttask" scheduled execution if result empty list!

workflow code:

@override public void myworkflow() {     promise<list<validationerror>> result = activities.validate(input);     handlevalidationresult(result);      promise<void> nextresult = activities.nexttask(input, result); }  @asynchronous public void handlevalidationresult(promise<list<validationerror>> result) {    system.out.println("why isn't being executed?"); } 

and validationerror looks (with lombok):

@value public class validationerror {     string message;     boolean isretryable; } 

validationerror missing default constructor (i.e. no-args constructor).

changed code be:

@data @noargsconstructor public class validationerror {     ... } 

the passing of objects between workflow , activities needs serialized , deserialized. swf therefore requires dataconverter this. default dataconverter jsondataconverter underpinned jackon. jackson requires no-arg constructor default, lombok's @value not provide no-args constructor. hence jackson wasn't able deserialize result activity. explains why empty list worked expected, non-empty list of validationerror didn't work expected.

it turns out jsondataconverter in swf throws dataconverterexception when encounters issue, somewhere in swf internals exception being swallowed. debugging difficult because when failure occurs in jsondataconverter nothing logged.

adding no-arg constructor resolves issue.


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -