cancel
Showing results for 
Search instead for 
Did you mean: 

JMS Receiver adapter like file variable substition method.

former_member262051
Participant
0 Kudos

Hi Experts,

I am working on file to JMS scenario, they want to pass the file names to the target by placing the order number(which is coming from the source payload) in the file.

Can some one please help me to over come from this situation.

regards,

Uday.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member262051
Participant
0 Kudos

Hi Experts,

Please help me here to overcome from above issue.

Regards,

Uday.

Harish
Active Contributor
0 Kudos

Hi Uday,

you can set the dynamic configuration variable to pass the value in JMS header property. Please refer the below blog

Unknown use case of DynamicConfigurationBean: Store file name to JMS header without mapping

one more option is RFH2 header

JMS channel custom RFH2 header settings

How to pass dynamic filename to Receiver JMS ch... | SCN

former_member262051
Participant
0 Kudos

Hi Harish,

Thanks for reply...

In my case I am using ESR objects and we need to place the file as file name with order number which is coming from source.

Example: in source file order number is ABC12345 then the file name will be xxxABCD1234xxx

Please help me in this case.

Regards,

Uday.

Harish
Active Contributor
0 Kudos

Hi Uday,

You can build the UDF to pass the required file name. Please refer the discussion thread which contains the UDF

link - How to pass dynamic filename to Receiver JMS ch... | SCN

//UDF code

String filename="";

String NameSpace = "http:/"+"/sap.com/xi/XI/System/JMS";

try{

      DynamicConfiguration conf = (DynamicConfiguration) param.get(

        StreamTransformationConstants.DYNAMIC_CONFIGURATION);

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

       // read filename value

       filename = conf.get(key);    

       

      // So far we extracted filename value .. now do your logic  something like this...

      DynamicConfigurationKey key2 = DynamicConfigurationKey.create(NameSpace,"yourjmsvalue goes here");

       conf.put(key2,filename);

     } catch(Exception e){

       }

former_member262051
Participant
0 Kudos

Hi Harish,

I have used the same but I am getting error for the above UDF.

saying Syntax error expecting ; for the line 6.

I have very little knowledge on udfs, kindly help me here.

Regards,

Uday.