Java Code Examples for io.smallrye.reactive.messaging.annotations.Broadcast

The following examples show how to use io.smallrye.reactive.messaging.annotations.Broadcast. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
public EmitterConfiguration(String name, OnOverflow onOverflow, Broadcast broadcast) {
    this.name = name;

    if (onOverflow != null) {
        this.overflowBufferStrategy = onOverflow.value();
        this.overflowBufferSize = onOverflow.bufferSize();
    } else {
        this.overflowBufferStrategy = null;
        this.overflowBufferSize = -1;
    }

    if (broadcast != null) {
        this.broadcast = Boolean.TRUE;
        this.numberOfSubscriberBeforeConnecting = broadcast.value();
    } else {
        this.broadcast = Boolean.FALSE;
        this.numberOfSubscriberBeforeConnecting = -1;
    }
}
 
Example 2
Source Project: knative-tutorial   Source File: FruitsEventProcessor.java    License: Apache License 2.0 5 votes vote down vote up
@Incoming("fruit-events")
@Outgoing("fruit-events-stream")
@Broadcast
public String processFruitEvent(String feJson ) {
    logger.info("SSE Data:" + feJson);
    return feJson;
}
 
Example 3
Source Project: quarkus-quickstarts   Source File: PriceConverter.java    License: Apache License 2.0 5 votes vote down vote up
@Incoming("prices")
@Outgoing("my-data-stream")
@Broadcast
public double process(byte[] priceRaw) {
    int priceInUsd = Integer.parseInt(new String(priceRaw));
    System.out.println("Receiving price: " + priceInUsd);
    return priceInUsd * CONVERSION_RATE;
}
 
Example 4
Source Project: if1007   Source File: Receiver.java    License: MIT License 5 votes vote down vote up
@Incoming("names")
@Outgoing("names-stream")
@Broadcast
public String processMessage(String receivedName) {
    log.info(receivedName);
    return String.format(template, receivedName);
}
 
Example 5
@Incoming("in")
@Outgoing("out")
@Broadcast
public int increment(int i) {
    return i + 1;
}
 
Example 6
@Incoming("in")
@Outgoing("out")
@Broadcast(2)
public int increment(int i) {
    return i + 1;
}
 
Example 7
@Outgoing("Y")
@Incoming("X")
@Broadcast(2)
public String process(String s) {
    return s.toUpperCase();
}
 
Example 8
@Outgoing("in")
@Broadcast(4)
public Multi<String> generate() {
    return Multi.createFrom().items(
            "a", "b", "c", "skip", "d", "skip", "e", "f", "skip", "g", "h", "i", "skip", "j");
}
 
Example 9
@Outgoing("in")
@Broadcast(4)
public Multi<String> generate() {
    return Multi.createFrom().items(
            "a", "b", "c", "skip", "d", "skip", "e", "f", "skip", "g", "h", "i", "skip", "j");
}
 
Example 10
@Outgoing("source")
@Broadcast(2)
public Publisher<String> foo() {
    return ReactiveStreams.of("a", "b").via(UnicastProcessor.create()).buildRs();
}
 
Example 11
Source Project: quarkus-quickstarts   Source File: PriceConverter.java    License: Apache License 2.0 4 votes vote down vote up
@Incoming("prices")
@Outgoing("my-data-stream")
@Broadcast
public double process(int priceInUsd) {
    return priceInUsd * CONVERSION_RATE;
}
 
Example 12
Source Project: quarkus-quickstarts   Source File: PriceConverter.java    License: Apache License 2.0 4 votes vote down vote up
@Incoming("prices")
@Outgoing("my-data-stream")
@Broadcast
public double process(int priceInUsd) {
    return priceInUsd * CONVERSION_RATE;
}
 
Example 13
Source Project: quarkus   Source File: BroadcastLiteral.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public Class<? extends Annotation> annotationType() {
    return Broadcast.class;
}
 
Example 14
@Inject
public void setEmitter(@Channel("sink-1") @Broadcast Emitter<String> sink1,
        @Channel("sink-2") @Broadcast @OnOverflow(value = OnOverflow.Strategy.BUFFER, bufferSize = 4) Emitter<String> sink2) {
    this.emitterForSink1 = sink1;
    this.emitterForSink2 = sink2;
}
 
Example 15
Source Project: quarkus   Source File: MyProcessor.java    License: Apache License 2.0 4 votes vote down vote up
@Incoming("input")
@Outgoing("processed")
@Broadcast
public String process(String input) {
    return input.toUpperCase();
}