liveBook · Manning

Message

As explained in Spring in Action, Sixth Edition

An integration message is a data-bearing unit that moves through components of an integration flow.

A message carries data through an integration flow. Components process it as it enters or leaves an application, and message channels connect those components like pipes. A flow can transform, split, aggregate, route, or process messages before they reach an exit point. section 10.0 section 10.4 section 10.2.1

The channel affects how a message moves:

  • A PublishSubscribeChannel passes a published message to every consumer. section 10.2.1
  • A QueueChannel holds messages until consumers pull them; each message goes to one consumer. section 10.2.1
  • A DirectChannel invokes one consumer in the sender’s thread. It is the default input channel in Java configuration and the Java DSL. section 10.2.1

An order moving between components

An order can be sent as a message and received by another component. With JMS, JmsTemplate can convert an order object into a Message before sending it; a receiver can obtain the raw Message or have it converted back to an order. These are JMS examples of the broader idea of carrying application data in a message, not a claim that every messaging API uses the same Message type. section 9.1.2 section 9.1.3

@Bean
public IntegrationFlow orderFlow() {
  return IntegrationFlows
      ...
      .channel("orderChannel")
      ...
      .get();
}

The Java DSL flow names orderChannel as a point through which messages pass; a different channel implementation can be declared as a bean when the default DirectChannel is not wanted. section 10.2.1

A message can carry more than its application data. For example, channel behavior can depend on a priority header; a Kafka listener can access a message’s payload and headers when it needs metadata as well as the order itself. section 10.2.1 section 9.3.3

How Spring in Action, Sixth Edition covers it

How deep it goes
Explains message movement through channels and common processing steps, without detailing an integration message implementation.
Examples
Illustrates order messages sent and received through JMS and a named channel in a Java DSL flow.
What you can do after
Evaluate/understand how messages carry application data through a flow and how channel choice changes their delivery.
How it connects
Connects messages to integration flows, message channels, service activators, gateways, channel adapters, and message headers.

Also explained in

Compare how 7 books explain message →

Related concepts

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