cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass dynamic filename to Receiver JMS channel

balaji_pichaimuthu
Active Participant
0 Kudos

Hi experts,

I want to pass the dynamic filename to receiver JMS message Properties.

for example

I am passing directory name via adapter module AF_Modules/DynamicConfigurationBean with key and value combination like below. How to pass dynamic filename value to a dynamic property ( say DCJMSMessageProperty1)

eg.

key.0 - >insert http://sap.com/xi/XI/System/JMS DCJMSMessageProperty0

value.0 - > testdirectory ( which is static value)

Note: Im have not created any ESR object . i just have to bypass the file to a jms queue. I have used AAE integrated configuration scenario ( file to jms )

Regards,

Balaji

Edited by: Balaji Pichaimuthu on Jan 27, 2011 4:45 PM

Edited by: Balaji Pichaimuthu on Jan 27, 2011 4:46 PM

Accepted Solutions (1)

Accepted Solutions (1)

RaghuVamseedhar
Active Contributor
0 Kudos

Hi Balaji,

Dyanamic values are possible using 1)Variable substition (but you do not want to access payload) 2)Dyanmic Configuration

Static values are possible using 1)channel configuration 2)DynamicConfigurationBean

Now to get Dynamic values, you have to create ESR objects (as said by Baskar Gopal).

a)You can create a full graphical mapping and use UDF (I do not recommend, as there is no transformations, or you may not have source and target structure).

b)You can achive this using Java Mapping (Dummy strutures). Check my response here [Link1|]

Regards,

Raghu_Vamsee

balaji_pichaimuthu
Active Participant
0 Kudos

Hi Raghu,

Can you give me code UDF which extrace the file name from dynamic configuration and write to jms property namely DCJMSMessageProperty3 in dynamic configuration

regards,

Balaji

Edited by: Balaji Pichaimuthu on Jan 28, 2011 11:47 AM

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Already given link for the dynamic configuration code snippet in the earlier reply... Below is the code snippet

Note: Use Adapter Specific Message Attributes for the target Communication Channel(CC).Check the indicator for filename in the advanced tab of CC

//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){

}

Answers (3)

Answers (3)

RaghuVamseedhar
Active Contributor
0 Kudos

Hi Balaji,

Can you please explain your requirment end to end?

Regards,

Raghu_Vamsee

RaghuVamseedhar
Active Contributor
0 Kudos

Hi Balaji,

Please try these values

key.0     insert http://sap.com/xi/XI/System Directory 
value.0   testdirectory

(OR)

key.0     insert http://sap.com/xi/XI/System/JMS Directory 
value.0   testdirectory

Regards,

Raghu_Vamsee

Edited by: Raghu Vamsee on Jan 27, 2011 12:47 PM

Edited by: Raghu Vamsee on Jan 27, 2011 12:48 PM

balaji_pichaimuthu
Active Participant
0 Kudos

Hi Raghu,

I can pass the directory name as below

key.0 - >insert http://sap.com/xi/XI/System/JMS DCJMSMessageProperty0

value.0 - > testdirectory ( which is static value)

My question is how to pass filename to jms property (JMS DCJMSMessageProperty1)

because it is dynamic value.

Regards,

balaji

baskar_gopalakrishnan2
Active Contributor
0 Kudos

I believe for the sake of dynamic filename you might have to create ESR objects and use UDF in mapping to achieve this.

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Use UDF and do dynamic configuration and

check this blog for reference

http://wiki.sdn.sap.com/wiki/display/Snippets/SAPXIDynamic+Configuration

balaji_pichaimuthu
Active Participant
0 Kudos

Hi Baskar,

Thanks for your reply.

But i am not using any ESR object here. Can we achieve via any inbuild adapter module

Thanks

Balaji