This repository was archived by the owner on Sep 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
pablo gonzalez granados
committed
May 13, 2021
1 parent
241691c
commit 31c56ba
Showing
5 changed files
with
22 additions
and
37 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
10 changes: 5 additions & 5 deletions
10
...ing/amqp-reactive/src/main/java/io/quarkus/ts/openshift/messaging/amqp/PriceProducer.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 |
---|---|---|
@@ -1,24 +1,24 @@ | ||
package io.quarkus.ts.openshift.messaging.amqp; | ||
|
||
import java.util.concurrent.TimeUnit; | ||
import java.time.Duration; | ||
|
||
import javax.enterprise.context.ApplicationScoped; | ||
|
||
import org.eclipse.microprofile.reactive.messaging.Outgoing; | ||
import org.jboss.logging.Logger; | ||
|
||
import io.reactivex.Flowable; | ||
import io.smallrye.mutiny.Multi; | ||
|
||
@ApplicationScoped | ||
public class PriceProducer { | ||
|
||
private static final Logger LOG = Logger.getLogger(PriceProducer.class.getName()); | ||
|
||
@Outgoing("generated-price") | ||
public Flowable<Integer> generate() { | ||
public Multi<Integer> generate() { | ||
LOG.info("generate fired..."); | ||
return Flowable.interval(1, TimeUnit.SECONDS) | ||
.onBackpressureDrop() | ||
return Multi.createFrom().ticks().every(Duration.ofSeconds(1)) | ||
.onOverflow().drop() | ||
.map(tick -> ((tick.intValue() * 10) % 100) + 10); | ||
} | ||
} |
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