@Outgoing declares a CDI method as a producer of messages to a named channel. The method becomes the source of a reactive messaging flow, while @Incoming identifies its consumer and both annotations can be combined for processing. section 9.3.2
Use @Outgoing within these messaging constraints:
- Pass one channel name, which identifies the channel receiving produced messages. section 9.3.2
- Place the method in an @ApplicationScoped or @Dependent CDI bean. section 9.3.2
- Connect one producer to one consumer, with optional processors communicating through uniquely named channels. section 9.3.2
- Use Quarkus's SmallRye Reactive Messaging implementation to connect channels to external systems through connectors such as Kafka or RabbitMQ. section 9.10
A timed producer
A producer can return a reactive stream rather than a single value: @Outgoing("ticks") produces five one-second ticks, which a processor maps to timestamps before a consumer prints them. section 9.3.2
@Outgoing("channel-name")
public String producer() {
return "hello";
}
Shows the minimal @Outgoing producer shape with a channel name and returned payload. section 9.3.2
