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

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

There is a newer version: 1.6.0.Beta15
Show newest version
package io.quarkus.qe;

import jakarta.enterprise.context.ApplicationScoped;

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

import io.smallrye.reactive.messaging.annotations.Broadcast;

/**
 * A bean consuming data from the "prices" Kafka topic and applying some conversion.
 * The result is pushed to the "my-data-stream" stream which is an in-memory stream.
 */
@ApplicationScoped
public class PriceConverter {

    public static final double CONVERSION_RATE = 0.88;

    @Incoming("prices")
    @Outgoing("my-data-stream")
    @Broadcast
    public double process(int priceInUsd) {
        return priceInUsd * CONVERSION_RATE;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy