O'Reilly logo

Just Spring Integration by Madhusudhan Konda

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Spring Expressions

Spring Integration endpoints support Spring Expression Language (SpEL) definitions. You can use the expressions to evaluate the properties on headers and payloads. For example, if you wish to extract a header property using the expression, the following snippet will help:

<int:header-enricher id="enricher"
  input-channel="in-channel" output-channel="out-channel">

  <int:header name="TARGET_SYSTEM" expression="headers.TARGET_SYSTEM"/>
</int:header-enricher>

The headers property will have the reference to MessageHeaders, so you can query the properties using headers.property_name syntax.

Similarly, the payload is available as the payload property, so you can query the payload object’s variable by using dot notation:

<int:enricher input-channel="in-channel" 
  request-channel="enricher-req-channel" 
  output-channel="stdout">
  <int:property name="price" 
    expression="payload.price"/>
</int:enricher>

Endpoints such as Transformers, Filters, Service Activators, and Splitters support the Spring Expressions.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required