Contact Free trial Login

@OutboundAttachments

Mule Runtime Engine versions 3.5, 3.6, and 3.7 reached End of Life on or before January 25, 2020. For more information, contact your Customer Success Manager to determine how you can migrate to the latest Mule version.

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.

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

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub