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

@OutboundAttachments

This parameter annotation is used to inject a attachments map into your component or transformer that can be used to write attachments to an outgoing messaging without having to deal with the org.mule.api.message.MuleMessage directly. This makes your code more portable and easier to test in isolation.
There are no parameters for this annotation and the parameter must be java.util.Map<String, DataHandler>. Any outbound attachments set by previous elements in a Flow will be accessible and writable in this map.


       
    
1
2
3
4
5
6
public class MyComponent {
    public Object process(@Payload Document doc,
                  @OutboundAttachments Map<String, DataHandler> outAttachments) {
        // do stuff
    }
}

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.

+