You are viewing an older version of this section. Click here to navigate to the latest version.

Injecting the Payload

Used on components, this annotation marks the method parameter that will be used to pass in the message payload. Note that the parameter type will be used to do any auto conversions using transformers available inside the Mule container. Mule has a number of standard transformers for dealing with common Java types such as XML documents, streams, byte arrays, strings, etc. It is also very easy for users to define their own Transformers.


A method annotated with @Processor can have at most one parameter annotated with @Payload, @InboundHeaders, @InvocationHeaders or @OutboundHeaders.

For example this is not possible:


Inject the payload without specifying the type:

Inject the payload which is of type byte[] and return a java.lang.String

In this topic: