liveBook · Manning

@Outgoing

As explained in Quarkus in Action

@Outgoing is a MicroProfile Reactive Messaging annotation that declares a method as a producer of messages to a channel.

@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

How Quarkus in Action covers it

How deep it goes
Explains channel arguments, CDI scopes, topology constraints, and reactive-stream implementation, but not annotation internals.
Examples
Uses a string producer, a five-tick Mutiny stream, timestamp transformation, and console consumption.
What it assumes
Assumes CDI methods and asynchronous messaging basics while introducing channels, producers, consumers, and processors.
What you can do after
Build it from scratch by adding an @Outgoing method and connecting its channel to consumers, processors, or messaging connectors.
How it connects
Connects @Outgoing with @Incoming, reactive streams, CDI beans, processors, channels, connectors, Kafka, and RabbitMQ.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Quarkus in Action. The section links point to the parts of the book it draws on.