cancel
Showing results for 
Search instead for 
Did you mean: 

MQ to File: How to send a Filename from JMS Header (MQ) to a File Adapter

mayur_patel6
Participant
0 Kudos

Hello Experts,

I have a flat file coming into PI via JMS adapter (MQ) and going out on a File adapter (NFS). We would like to keep the file name consistence throughout the transaction. While coming from MQ our sender is sending the filename in one of the MQ Headers (JMSCorrelationID). We are trying to figure out how to read the file name from the MQ header and send it to the file adapter. Please let us know any other suggestions.

Thanks,

Mayur

Accepted Solutions (1)

Accepted Solutions (1)

former_member181985
Active Contributor
0 Kudos

Use this UDF code in MessageMapping.

try
{

DynamicConfiguration conf = (DynamicConfiguration) 
container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey KEY_JMSCorrID = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/JMS","DCJMSCorrelationID");


DynamicConfigurationKey KEY_FILENAME = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

conf.put(KEY_FILENAME, conf.get(KEY_JMSCorrID));

}
catch(Exception e){}
return a; //a is some input field.

Enable ASMA on receiver File channel.

Edited by: Praveen Gujjeti on Mar 17, 2010 9:23 AM

mayur_patel6
Participant
0 Kudos

Hello Praveen,

Thanks for a quick response. Unfortunately, we don't have a message mapping since it is a flat file and we are delivering it as it is without any mappings. It is pretty much like a batch transfer. We are also using Integrated Scenarios for this. Is there any other way to do this without using ESR objects?

Thanks,

Mayur

rajasekhar_reddy14
Active Contributor
0 Kudos

Then its not possible.

Use message mapping,content conversion in both JMS Sender CC and Receiver File CC,use UDF.

Regards,

Raj

former_member181985
Active Contributor
0 Kudos

May be you can use Dynamic Configuration Bean in receiver file Adapter channel.

Check this link: [DynamicConfigurationBean|http://help.sap.com/saphelp_nw2004s/helpdata/en/45/da2239feb22e98e10000000a155369/content.htm]

Edited by: Praveen Gujjeti on Mar 17, 2010 5:43 PM

mayur_patel6
Participant
0 Kudos

Thanks Praveen, this looks promising. I will try it out and update the post. Again, thanks for your help and a quick response.

Regards,

Mayur

former_member181985
Active Contributor
0 Kudos

You can also check SAPNote for further help:

[ Note 974481 - XI Adapter Framework DynamicConfiguration Module|https://service.sap.com/sap/support/notes/974481]

mayur_patel6
Participant
0 Kudos

Thanks Praveen. All of you replies helped us figure out which direction to take.

- Mayur

Former Member
0 Kudos

Hi Mayur,

Can u tell me how did you resolved the issue.We have the same requirement.Sender is JMS and receiver is file.No mapping involved.How to read the JMS Property in SAP PI.

Answers (0)