user1052610
user1052610

Reputation: 4719

Spring Integration XML: getting value from message header

A Message object is passed to a service activator bean definition in XML as follows:

<int:service-activator>
  <bean class="BatchWriter"
    p:headerValue="...">
  </bean>
</int:service-activator>

Within XML, what is the correct syntax to use to get a specific header value from the message and pass it as a parameter to the service activator bean?

Thanks

Upvotes: 0

Views: 861

Answers (1)

Artem Bilan
Artem Bilan

Reputation: 121552

This should be enough for you:

class BatchWriter {

    MyPojo2 service(MyPojo1 payload, @Header("foo") Object foo) {
        ....
    }

}

So, the @Header does the stuff.

Cheers

Upvotes: 1

Related Questions