Skip to content

Commit

Permalink
fix(sqs,sns): from with a list of objects
Browse files Browse the repository at this point in the history
  • Loading branch information
loicmathieu committed Aug 22, 2024
1 parent 90e8fd3 commit b8f9a0b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main/java/io/kestra/plugin/aws/sns/Publish.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ public Publish.Output run(RunContext runContext) throws Exception {

} else if (this.from instanceof List) {
flowable = Flux
.fromArray(((List<Message>) this.from).toArray())
.cast(Message.class);
.fromIterable((List<?>) this.from)
.map(map -> JacksonMapper.toMap(map, Message.class));

resultFlowable = this.buildFlowable(flowable, snsClient, topicArn, runContext);

Expand Down
6 changes: 4 additions & 2 deletions src/main/java/io/kestra/plugin/aws/sqs/Publish.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import java.io.InputStreamReader;
import java.net.URI;
import java.util.List;
import java.util.Map;

import jakarta.validation.constraints.NotNull;

import static io.kestra.core.utils.Rethrow.throwFunction;
Expand Down Expand Up @@ -85,8 +87,8 @@ public Output run(RunContext runContext) throws Exception {

} else if (this.from instanceof List) {
flowable = Flux
.fromArray(((List<Message>) this.from).toArray())
.cast(Message.class);
.fromIterable((List<?>) this.from)
.map(map -> JacksonMapper.toMap(map, Message.class));

resultFlowable = this.buildFlowable(flowable, sqsClient, queueUrl, runContext);

Expand Down

0 comments on commit b8f9a0b

Please sign in to comment.