SQS Sending/Receiving Message in mutiny reactive #40654
Replies: 12 comments 7 replies
-
/cc @cescoffier (mutiny), @jponge (mutiny) |
Beta Was this translation helpful? Give feedback.
-
I don't believe the SQS connector is supported in Quarkus. For sure adding the ASM dependency is not great (lots of clashes). I think @ozangunalp had an example somewhere. |
Beta Was this translation helpful? Give feedback.
-
Normally you don't need the asm dependency, there must be some incompatible versioning.
The |
Beta Was this translation helpful? Give feedback.
-
when used consume event and passed an param as part of function it fails with Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.ClassVisitor do you have any suggestions on triggering to sqs via event bus or alternate approaches to receive param |
Beta Was this translation helpful? Give feedback.
-
When providing a stack trace, please provide the full stack trace, not just the message. Otherwise it's impossible for us to know what triggered it. Also your dependency tree might be of interest. |
Beta Was this translation helpful? Give feedback.
-
apologies @gsmet here we have the trace.
dependencies
|
Beta Was this translation helpful? Give feedback.
-
+1 Also the event bus |
Beta Was this translation helpful? Give feedback.
-
you mean sqs outgoing channel? //At producer Existing
private final EventBus eventBus;
//Existing
.invoke(usageDataEntity -> eventBus.send("EVENTBUS", usageDataEntity))
// new?
.invoke(usageDataEntity -> eventBus.send("sqs-channel", usageDataEntity)) //At consumer responsible for sending events to sqs
@Outgoing("sqs-channel") //Existing
@ConsumeEvent("EVENTBUS")
@Outgoing("sqs-channel") // new?
public Multi<Message<String>> generate(final List<String> itemsTOSqs) {
return Multi.createFrom().iterable(itemsTOSqs).map(udmUsageData -> Message.of(itemTOSqs, Metadata.of(SqsOutboundMetadata.builder()
.deduplicationId("id001")
.groupId("groupId")
.build())));
} is this what you are expecting |
Beta Was this translation helpful? Give feedback.
-
You can either use the emitter directly :
Or use an internal channel instead of event bus:
Or if your
The pseudocode may have some errors but I hope you get the idea. |
Beta Was this translation helpful? Give feedback.
-
@ozangunalp Thanks for your response. I have tried with emitter way which doesn't have any issue till sending messages, however it doesn't log error or emit message to queue eventBus.send("SQS_EVENT", List.of("Sample")) // producer
@Channel("sqs_channel")
Emitter<String> sqsEmitter;
@ConsumeEvent("SQS_EVENT")
public void sendToSQSQueue(final List<String> itemsToSqs) {
sqsEmitter.send("...message"); // some plain string to test
}
public class SqsConfig {
@Produces
public SqsAsyncClient sqsAsyncClient() {
return SqsAsyncClient.builder()
.region(Region.of("us-west-2"))
.build();
}
} using a internal channel on field fails with injection error '@Outgoing' not applicable to field @Outgoing("sqs-sender")
private final Emitter<List<String>> sqsEmitter; If possible can you share a working example or let me know if needed a reproducible code. |
Beta Was this translation helpful? Give feedback.
-
I've pushed an example project here: https://github.com/ozangunalp/quarkus-aws-sqs-connector If you send a reproducer I can take a look. I am changing this issue to a discussion. |
Beta Was this translation helpful? Give feedback.
-
/cc @cescoffier (mutiny), @jponge (mutiny) |
Beta Was this translation helpful? Give feedback.
-
Description
reactive messaging SQS
as per documentation I have used below two dependencies
which fails with "Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.ClassVisitor" ended up adding
can we have an example with SQS sending and receiving messages.
using application.yaml
which doesn't log any error and I don't see messages in sqs queue. Can we have a clear dependencies list and enhance documentation which would really help.
Implementation ideas
No response
Beta Was this translation helpful? Give feedback.
All reactions