All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkus.qe.PriceConsumer Maven / Gradle / Ivy

The newest version!
package io.quarkus.qe;

import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;

import jakarta.enterprise.context.ApplicationScoped;

import org.eclipse.microprofile.reactive.messaging.Incoming;

/**
 * A simple resource retrieving the in-memory "my-data-stream" and sending the items as server-sent events.
 */
@ApplicationScoped
public class PriceConsumer {

    private final ConcurrentLinkedQueue prices = new ConcurrentLinkedQueue<>();

    @Incoming("my-data-stream")
    public void process(Double price) {
        this.prices.add(price);
    }

    public Queue getPrices() {
        return prices;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy