Unknown use case of DynamicConfigurationBean: Store file name to JMS header without mapping
The PI adapters use dynamic header fields (also called Adapter Specific Message Attributes = ASMA) for enhancing the functionality of the adapter. Sender adapters provide information in the dynamic headers and receiver adapters can use that information for different purposes, like using a specific filename in file adapter.
The receiver JMS adapter uses the dynamic header fields to store values in JMS header. For this purpose there is a standard adapter module DynamicConfigurationBean which allows to set PI message header fields to JMS header.
If you want to copy dynamic headers from other adapters to the JMS header, this is a little bit tricky: You have to apply two entries of the DynamicConfigurationBean in the module chain. The first module stores the dynamic header field in the module context, the second module reads it from there. The parameters are identified by the prefix “module.”
The first module has following parameters:
key.1 write http://sap.com/xi/XI/System/File FileName
The second module:
key.1 read http://sap.com/xi/XI/System/JMS DCJMSMessageProperty0
If you want to read the file name from a JMS header in a sender channel, you exchange source and target and make sure that you place the DynamicConfigurationBean entries at the right place, direct before the CallSapAdapter module:
When you have the Modules in the sender channel, you can check with SXMB_MONI that the dynamic header field is copied correctly:
- You can use the two additional modules in file adapter channel or JMS adapter channel, but you can not split the two modules to different channels.
- You cannot use a single DynamicConfigurationBean for read and write, as all write commands are processed before the read commands, no matter how the commands are arranged in the module chain.
I've tried your suggestion with the JMS sender module configuration but it wasn't successful.
Checking @ the CC log it shows the following info: reading and writing with value null
I manage to get it now =)
Poh Ian Koh ,
Hi Poh ,
I'm getting same error as like you "FileName with value null;" when using the Stefan's blog. Can you please help by giving suggest.
I able to get now & error is fixed.
Thanks a lot Stefan Grube 🙂
Thanks for the great blog. For HTTP to File, this works without adding those specific Modules. Just by adding AF_Modules/DynamicConfigurationBean, we get the ASMA Filename set.