Passing message content as attachment

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Passing message content as attachment

Thibault
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Passing message content as attachment

Vincent Zurczak
Hi,

Which service is in charge of the third step?
Is it a POJO too? Which operation do you call on the XSLT component?
« Petals M.D. »
Reply | Threaded
Open this post in threaded view
|

Re: Passing message content as attachment

Thibault
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Passing message content as attachment

Vincent Zurczak
tcassan wrote
since the other operation, that write output into attachement is marked as nearly deprecated on the documentation...
Actually, there is a third operation, that replaces the depreciated one (transformToMTomAttachment).

tcassan wrote
The third step is handled by a POJO, because I didn't find any standard component to handle this (on the other hand, I didn't find a way to this with a POJO neither). If any exists, I am realy willing to use it
The POJO is fine for such a case.
Try exchange.getInMessageAsDocument() to get the input message as a document.
« Petals M.D. »
Reply | Threaded
Open this post in threaded view
|

Re: Passing message content as attachment

Thibault
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Passing message content as attachment

Vincent Zurczak
This post was updated on .
tcassan wrote
EDIT: I checked again: actually, I made a mistake. I have this operation in the helper, I just thought this was the one that was deprecated. I think I will use this operation then, since it seems to do the trick I want. If you have some time to answer, I am still interested in a POJO styled solution.
It depends on the way you want to return the attachment.
The simple solution is to create a data handler (take a look at the Talend SE in the Petals source code for an example) and to attach it to the exchange.

For a better solution, you should use a MTOM attachment.
It means there is an attachment and that this attachment is referenced in the XML payload. There are utilities in the CDK to do it. Or you can take a handy approach (once again, take a look at the Talend SE, the abstract processor how to add MTOM attachments on Petals messages).
« Petals M.D. »
Reply | Threaded
Open this post in threaded view
|

Re: Passing message content as attachment

Thibault
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Passing message content as attachment

Thibault
This post was updated on .
CONTENTS DELETED
The author has deleted this message.