问题
What would I return from a Java SES receiving lambda to cause the rules to stop?
AWS provide examples in Node, but what would this look like in Java?
https://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-action-lambda-example-functions.html
exports.handler = function(event, context, callback) {
...
// Stop processing rule set, dropping message
callback(null, {'disposition':'STOP_RULE'});
} else {
callback(null, null);
}
};
How would I do this with the Java SDK though?
@Override
public Object handleRequest(Object request, Context context) {
//Return what?
}
Simply returning the String "STOP_RULE" doesn't work.
回答1:
It appears that the Java SDK works the same ways as Node. The difference been that the SDK must use Jackson to serialize the objects on the way out. Returning JSON Strings won't work, but objects will:
return Collections.singletonMap("disposition", "STOP_RULE");
来源:https://stackoverflow.com/questions/56581664/aws-simple-email-service-java-receive-lambda-stop-rule