7 Replies Latest reply on Dec 12, 2011 4:43 AM by Ravi Challapalli

    Retain camel exchange.attachments

    Ravi Challapalli Newbie


      I wrote a custom unmarshaler/marshamler for multipart messages that are received over a jetty endpoint. One of the attachments is set as body of the exchange and rest are added to the exchange as belows


      exchange.getIn().addAttachment(contentId, dataHandler)



      The unmarshaler does this job to preserve the attachments for marshaling later.


      Problem is I am unable to get these attachments back from the exchange in the marshal() method.


      exchange.getIn().getAttachments() size is zero.


      Can some one please explain what happens to the attachments in the transit? What needs to be done to retain them for accessing them in the marshalling method?


      Thanks in advance!!