Skip to content

AWS Lambda: Add option to opt-out of special handling of the "payload" field #1425

Description

@mrjv

Note: This ticket is a duplicate of the already closed #1154, but was raised again for visibility (I don't have permissions to reopen closed tickets). - Feel free to close it and reopen the original ticket instead.

The AWSLambdaUtils.java currently have special handling for Lambda payloads containing a "payload" field:

MessageBuilder builder = MessageBuilder
.withPayload(structMessage instanceof Map msg && msg.containsKey("payload")
? (msg.get("payload"))
: payload);

The following Lambda payload:

{
  "someProperty": "someValue",
  "payload": {
    "otherProperty": "otherValue"
  }
} 

results in only {"otherProperty": "otherValue"} being passed to the Spring cloud function. We would like to opt out from this behavior and are on a high level looking for something like the following:

 MessageBuilder builder = MessageBuilder 
 		.withPayload(SOME_PAYLOAD_EXTRACTION_FLAG && structMessage instanceof Map msg && msg.containsKey("payload") 
 				? (msg.get("payload")) 
 				: payload); 

Where we would set SOME_PAYLOAD_EXTRACTION_FLAG to false using a configuration or similar. Completely removing the special logic would also be fine, but it was probably added for some reason?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions