Access Keys:
Skip to content (Access Key - 0)
Cancel    
Cancel   

Contents

Message attachment transformation improvements

Design open for discussion

Currently mule has not build-in functionality to manage message attachments through xml configuration forcing users to implement custom message transformers.

The idea is to add missing functionality to fully support attachment management (add/remove/copy) with xml configuration.

Story

Story: As a user I want to be able to add / remove / copy message attachments in a in a simple, powerful and consistent way

JIRA Issue

MULE-6074

How to add an attachment

How to delete an attachment

How to copy inbound attachments to outbound attachments

How to add an attachement using an enricher

Attachment enrichement will be done by the use of new Mule expression language instead of a particular attachment enricher

  • Attachment expression has been augmented to declare a content type
  • If source resolves to a javax.activation.DataHandler instance then that instance will be put as attachment without reusing DataHandler content type.
  • If there's no content type in the target expression and source resolves to something else than a javax.activation.DataHandler and exception will be thrown
  • The initial idea was to use name instead of key since it makes more sense than key. The problem is that name is used for another purpose in Mule so calling it name would create an inconsistence.

Acceptance criteria

  • Configuration should not allow empty key or empty value attributes
  • If expression for key or value return null then the transformer must not fail and must not change any properties/variables
  • If key expression returns an object then that object .toString() method should be use to generate the key
  • Regular expression should be supported in key attribute of copy-attachemnts and remove-attachment elements. The kind of regular expression supported are:
    • Any valid java regex
    • * meaning everything
    • MULE* meaning everything that starts with MULE prefix
    • *MULE meaning everything that ends with MULE sufix