Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-4797

DataFormat - unmarshal should allow to return Message or Exchange to make it more flexible

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.10.0
    • camel-core
    • None
    • Moderate

    Description

      The API of the unmarshal on DataFormat is

          Object unmarshal(Exchange exchange, InputStream stream) throws Exception;
      

      The Object returned is by default the message body. But we should allow end user to return also a

      • org.apache.camel.Message
      • org.apache.camel.Exchange

      If its a Message then use the message returned.
      If its a Exchange then copy the results from the exchange to the current exchange (normally it would be the same instance, so its a noop operation)

      We supports this for the splitter, where people can return a List<Message> in the split expression etc.

      Attachments

        Activity

          People

            bvahdat Babak Vahdat
            davsclaus Claus Ibsen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: