forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support repeatable Incomings annotation for reactive messaging
- Assign the bean as unremovable - Kafka serde discovery Fixes quarkusio#32002
- Loading branch information
1 parent
482d14e
commit ab62972
Showing
8 changed files
with
110 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
.../reactive-messaging-kafka/src/main/java/io/quarkus/it/kafka/KafkaRepeatableReceivers.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package io.quarkus.it.kafka; | ||
|
||
import java.util.List; | ||
import java.util.concurrent.CompletionStage; | ||
import java.util.concurrent.CopyOnWriteArrayList; | ||
|
||
import jakarta.enterprise.context.ApplicationScoped; | ||
|
||
import org.eclipse.microprofile.reactive.messaging.Incoming; | ||
import org.eclipse.microprofile.reactive.messaging.Message; | ||
|
||
@ApplicationScoped | ||
public class KafkaRepeatableReceivers { | ||
|
||
private final List<Double> prices = new CopyOnWriteArrayList<>(); | ||
|
||
@Incoming("prices-in") | ||
@Incoming("prices-in2") | ||
public CompletionStage<Void> consume(Message<Double> msg) { | ||
prices.add(msg.getPayload()); | ||
return msg.ack(); | ||
} | ||
|
||
public List<Double> getPrices() { | ||
return prices; | ||
} | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
...tion-tests/reactive-messaging-kafka/src/main/java/io/quarkus/it/kafka/PricesProducer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package io.quarkus.it.kafka; | ||
|
||
import jakarta.enterprise.context.ApplicationScoped; | ||
|
||
import org.eclipse.microprofile.reactive.messaging.Outgoing; | ||
|
||
import io.smallrye.mutiny.Multi; | ||
|
||
@ApplicationScoped | ||
public class PricesProducer { | ||
|
||
@Outgoing("prices-out") | ||
public Multi<Double> generatePrices() { | ||
return Multi.createFrom().items(1.2, 2.2, 3.4); | ||
} | ||
|
||
@Outgoing("prices-out2") | ||
public Multi<Double> generatePrices2() { | ||
return Multi.createFrom().items(4.5, 5.6, 6.7); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters