You are viewing an older version of this topic. To go to a different version, use the version menu at the upper-right. +

@Payload Annotation

A parameter injection annotation that can be used on component entry points and transformer methods defined using the @Transformer annotation, this annotation controls how the current message payload is passed into a method by performing automatic transformation of the message payload to match the annotated parameter type. For example, if you are expecting an XML document, this can be injected into a component entry point and automatically converted into a org.wc3.dom.Document.

public class MyComponent {
    public Object process(@Payload Document doc) {
        // do stuff

Annotated Component Methods

Note that when using Annotations on component methods, all parameters need to be annotated for the method to be invoked. You will almost always be using the @Payload annotation to mark the message payload parameter.

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.