io.quarkus.qe.PriceConverter Maven / Gradle / Ivy
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