cancel
Showing results for 
Search instead for 
Did you mean: 

How can i get message id as file name in Receiver Mail Adapter

Former Member
0 Kudos

Hi All,

We are working on file to mail scenario. Client requirement is " Attached file name should be the message id" How can we achieve this.

Thanks & Regards,

Purshothamm

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

To have the file name as message id, I think the below blogs can help you…

/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14

/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii

Regards,

Vijay N

GabrielSagaya
Active Contributor
0 Kudos

for xi message id u need to have it implemented using udf.

function myudf(String a,Container container)

{

java.util.Map map = container.getTransformationParameters();

String msgid = (String) map.get ( StreamTransformationConstants.MESSAGE_ID);

a=msgid+"_"a;

return a;

}

If a is filename, You can append message id to filename and pass it to the target element.

Former Member
0 Kudos

Hi Selvam,

Thanks for your quick reply.

Thanks & Regards,

Purshothamm