liveBook · Manning

@Incoming

As explained in Quarkus in Action

@Incoming is a MicroProfile Reactive Messaging annotation that declares a method as a consumer of messages from a channel.

@Incoming is a MicroProfile Reactive Messaging annotation that marks a CDI method as a consumer of messages from a named channel. The method becomes the sink of a reactive messaging flow, receiving payloads produced elsewhere. section 9.10 section 9.3.2

The annotation takes one channel name, such as "channel-name". A channel normally connects one producer to one consumer, with optional processors between them; each processor uses distinct incoming and outgoing channels. Quarkus delegates the flow to SmallRye Reactive Messaging. section 9.3.2 section 9.10

Consume a channel

@Incoming("channel-name") public void consumer(String payload) { System.out.println(payload); } The method receives each channel payload. A method can also combine @Incoming with @Outgoing to transform messages, while a reactive method can receive and return a Mutiny stream.

@Incoming also supports integration testing. A Quarkus test can declare a consumer for the relevant channel, collect or verify received messages, and use Awaitility when broker delivery is asynchronous. Configure test-only channel properties when the test replaces an application sink. section 9.7.1

How Quarkus in Action covers it

How deep it goes
Explains channel topology, CDI scope limits, implementation behavior, stream processing, and asynchronous testing, but not annotation internals.
Examples
Demonstrates a payload-printing consumer, a Mutiny transformation pipeline, and a RabbitMQ invoice consumer in a Quarkus test.
What it assumes
Assumes CDI beans and asynchronous messaging, while defining channels, producers, consumers, processors, and connector roles.
What you can do after
Apply it via Quarkus and SmallRye Reactive Messaging to consume channel payloads, transform streams, or verify broker messages asynchronously.
How it connects
Connects consumers with CDI beans, reactive streams, @Outgoing, processors, SmallRye Reactive Messaging, Kafka, RabbitMQ, and Mutiny.

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.