2

I am using quarkus version: 1.5.2.Final and the following dependency to include reactive messaging (I have a running docker instance of Artemis in between the sender and receiver project):

<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-smallrye-reactive-messaging-amqp</artifactId>
</dependency>

On the sender project I have a @Outgoing('stock-quote') annotation on a method that produces a random number every second and returns Flowable<Message<String>>. The configuration is as follows:

mp.messaging.outgoing.stock-quote.connector=smallrye-amqp
mp.messaging.outgoing.stock-quote.address=stocks
mp.messaging.outgoing.stock-quote.durable=true

On the receiver project the receiver is located which has a method with the annotation @Incoming('stock)'. The configuration is as follows:

mp.messaging.incoming.stocks.connector=smallrye-amqp
mp.messaging.incoming.stocks.durable=true

What do I notice? Everything works as it should. When the receiver project goes down for whatever reason, the messages that are still being sent by the sender are persisted, which is good. However, when the receiver comes back online again, the receiver does not receive the persisted messages, instead it starts on a separate 'client thread'. The persisted messages just stay there.

I tried to also add the @Broadcast annotation on the sender side. Since I also want that there are multiple instances of receiver, so the messages are being divided over the receivers. Then, when a receiver goes offline, the messages are being persisted again. When the receiver comes back up it gets the new messages being sent, but the persistent messages just stay there (in another 'client thread', and worse, the persistent messages on this 'client thread' are accumulating (due to the broadcast).

So what do I want? I want that there is a sender that sents messages. These messages are being divided over two or more receiver instances. If one receiver goes down, the messages are being taken care of by the other instances. If all the receivers are down, the messages are being persisted, and once there are one or more receivers online again, these persisted messages are being processed. So basically I want this:

enter image description here

Anyone has any idea on how to do this with quarkus reactive messages in combination with artemis?

John Doe
  • 259
  • 1
  • 6
  • 18

0 Answers0