Skip to content

Commit 53b61e5

Browse files
committed
Revert "Polishing previous commit"
This reverts commit 57b8631.
1 parent 3f8b7f1 commit 53b61e5

File tree

1 file changed

+8
-11
lines changed
  • spring-cloud-function-adapters/spring-cloud-function-adapter-aws/src/main/java/org/springframework/cloud/function/adapter/aws

1 file changed

+8
-11
lines changed

spring-cloud-function-adapters/spring-cloud-function-adapter-aws/src/main/java/org/springframework/cloud/function/adapter/aws/AWSLambdaUtils.java

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ public static byte[] generateOutputFromObject(Message<?> requestMessage, Object
156156
}
157157
result.add(value);
158158
}
159-
160159
if (result.size() > 1) {
161160
output = result;
162161
}
@@ -166,17 +165,15 @@ else if (result.size() == 1) {
166165
else {
167166
output = null;
168167
}
169-
if (output != null && output instanceof Message<?>) {
170-
if (output instanceof Message<?>) {
171-
responseMessage = (Message<byte[]>) output;
172-
}
173-
else {
174-
if (logger.isDebugEnabled()) {
175-
logger.debug("OUTPUT: " + output + " - " + output.getClass().getName());
176-
}
177-
byte[] payload = objectMapper.toJson(output);
178-
responseMessage = MessageBuilder.withPayload(payload).build();
168+
if (output instanceof Message<?> && ((Message<?>) output).getPayload() instanceof byte[]) {
169+
responseMessage = (Message<byte[]>) output;
170+
}
171+
else if (output != null) {
172+
if (logger.isDebugEnabled()) {
173+
logger.debug("OUTPUT: " + output + " - " + output.getClass().getName());
179174
}
175+
byte[] payload = objectMapper.toJson(output);
176+
responseMessage = MessageBuilder.withPayload(payload).build();
180177
}
181178
}
182179
else {

0 commit comments

Comments
 (0)