Accesing Runtime Parameters using Dynamic configuration

Hi..
Can we access  the following  parameters from mapping using DYNAMIC CONFIGURATION key?
<SAP:TraceLevel>1</SAP:TraceLevel>
  <SAP:LogSeqNbr>000</SAP:LogSeqNbr>
  <SAP:RetryLogSeqNbr>000</SAP:RetryLogSeqNbr>
  <SAP:QIdInternal>XBTI0001</SAP:QIdInternal>
Please let me know how to access
Thanks
Ram

Hi Ram,
    I dont think we can achieve this one,only two ways to read any values at mapping level
1)Dynamic Configuration--Option ruled out....not possible,
2)Write some java coding to read the value,i think this one also not work it out.
your req unique..i am looking for answer..:)
Cheers,
Raj

Similar Messages

  • Getting file directory using dynamic configuration:Code needed

    Hi,
    I need the code for getting the source file directory name using dynamic configuration. Also, an explanation on how it can be used in mapping for comparison.
    Thanks,
    Vishal

    Hi Vishal,
      Refer  carefully the following blog by micheal to get the  Attributes dynamically during runtime by enabling the Adapter Specific message Attributes in adapter level.
      /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Create an UDF in mapping with no input parameters to it and include the piece of code and use it according to your requirement in mapping.
    //write your code here
    try{
    String filedirectory    = "";
    DynamicConfiguration conf1 = (DynamicConfiguration) container
        .getTransformationParameters()
        .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","Directory");
    filedirectory = conf1.get(key1);
    return filedirectory;
    catch(Exception e)
         String exception = e.toString();
          return exception;
    Thanks,
    Ram.

  • Problem:obtaing file name using Dynamic configuration of file adapter

    hi all
    I am using Dynamic configuration for getting file name.
    I am getting Dynamic configuration in SXMB_MONI containg file name, but payload is empty unlike file i am sending.

    Hi All,
    Basically my requirement to get Filename in idoc segments in order to validate the posting at month end.
    Its an File to idoc scenario- GL Posting.
    Please check attached UDF and it gives error. Kindly help. Thanks

  • Using Dynamic Configuration api for SOAP adapter

    I want to use Dynamic Configuration api to send a SOAP request to a webservice.
    tha value in my adapter is
    my Target URL  is
    http://xidr3.bcs.de:50000/XISOAPAdapter/MessageServlet? channel=:Routing2_Service:SS_SOAP_Sender_Working_June12&nosoap=true
    which is the corresponding field i have to set in Dynamic Configuration?
    I have written the following code is this right?
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    String temp = "http:/"+"/sap.com/xi/XI/System/SOAP";
    DynamicConfigurationKey key = DynamicConfigurationKey.create(temp, "TServerLocation");
    String varURL =
    "http:/"+"/xidr3.bcs.de:50000/XISOAPAdapter/MessageServlet?channel=:Routing2_Service:SS_SOAP_Sender_Working_June12&nosoap=true";
    conf.put(key,varURL);
    return "";

    Hi,
    Yes, your code looks fine. Can you let me know what is the error you are getting. Have you checked the Flag in your communication channel.
    Use Adapter-Specific Message Attributes
    Variable Transport Binding 
    Once you test your scenario you can see the Dynamic URL in your message Header by going to tcode sxmb_moni. See if you are able to find something called DynamicConfiguration in your message haeader. If yes what is the value set there.
    PS: From the target URL you posted It looks like your webservice is hosted on the XI box itself. Is it the same XI box or different box? Just curious to know.
    Reward point if answer is helpful
    Thanks
    Amit

  • Change Directory Path using Dynamic Configuration

    Hi,
    We have a requirement where the directory path for placing the files is different across our different environments. Ex: Development Environment has a different path than the Quality Enviornmnet. Also the full path is depending on fileds within the message.
    I want to use Dynamic Configuration to create the Directory path. But in order to capture the full requirement I need to know wheich environment I am within the User Defined Function.
    Can someone provide me the java class and function that I can use in my UDF to read the environment I am in.
    ( Essentially I want to read Sy-SYSID in ABAP...using Java. )
    Regards,
    Arunava

    Hi Arunva,
    >>Essentially I want to read Sy-SYSID in ABAP...using Java.
    It might not be possible to read system id in java, but you can read the sender or receiver service(SENDER_SERVICE or RECEIVER_SERVICE) and based on it can decide the diretory in DynamicConfiguration.
    If you have a sender or receiver SAP sysem then better to read its name because this business systm ill haeunique name aross different environment. Check this thread too
    User-defined function: RFC call
    Regards
    Suraj

  • Using dynamic configuration to modify parameter in sender channel?

    Hi,
    I would like to be able to set the filename in an SFTP sender communication channel (based upon a name determined at runtime, which is read from another file).
    My understanding is that parameters set in dynamic configuration can only be set as part of mapping therefore I cannot see how to set these before my sender communication channel is invoked.
    Please can someone confirm if there is a method of achieving this requirement.
    Thanks,
    Alan

    Hi,
    >>>My understanding is that parameters set in dynamic configuration can only be set as part of mapping therefore I cannot see how to set these before my sender communication channel is invoked.
    they can be set anywhere in the message flow - in adapter modules too for example
    >>>I would like to be able to set the filename in an SFTP sender communication channe
    you cannot set it before the adapter starts polling from anything else
    what you can do is to create a file -> java proxy (sftp) - anything flow
    read this another file first -> call SFTP from a java proxy in a sync way to fetch the second file using the name from the first one -> do anything else what you need
    you can also do the same with one adapter - axis (put the file fetching and sftp call inside one class)
    but it  requires some java knowledge - but it would work in one sender adapter in this case
    Regards,
    Michal Krawczyk

  • Get IDoc-number from flat IDoc using dynamic configuration

    Dear experts
    In an IDoc2File scenario I have added the IDoc-number to dynamic configuration using the folling code in an UDF:
    DynamicConfiguration conf = (DynamicConfiguration)
    container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey FileName = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","DOCNUM");
    conf.put(FileName, a);
    The information is stored in the SOAP message
    <SAP:DynamicConfiguration SOAP:mustUnderstand="1">
      <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="DOCNUM">0000000000012345</SAP:Record>
    </SAP:DynamicConfiguration>
    Can anybody tell me how I can access this information in the "variable substitution" section of the CC? Perhaps something like "message:docnum"?
    Additional information:
    Taking the IDoc-number from the payload using e.g. "payload:ORDERS05,1,IDOC,1,EDI_DC40,1,DOCNUM,1" does not work, since the XML-IDoc has been converted to an flat-IDoc.
    Thanks in advance for any good ideas
    Markus

    Dear Rodrigo and Sarvesh
    Thanks for your help so far! I applied your hints and now it is working fine.
    But now I have the following additional questions
    1.) My message mapping only maps the input IDoc to an output IDoc of the same type and structure. The MM is only required to process the UDF. Is there another, better solution to achieve my requirement that the IDoc-number shall be part of the filename?
    2.) In the CC you have the possibility to use temporary files (section "Processing", Option "Put File" = "Use Temporary File". I think this will not work with the given solution, will it?
    To possibly help somebody else or clarify the mechanism once again, I wrote down how my solution now looks like.
    My UDF in the message-mapping looks like this
    - Input = DOCNUM of IDoc, e.g. ORDERS05/IDOC/EDIDC/DOCNUM
    - Outpt = DOCNUM of IDoc, e.g. ORDERS05/IDOC/EDIDC/DOCNUM
    - UDF:
    public String putDynamicConfiguration(String docnum, Container container) throws StreamTransformationException{
    try
         DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
         DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
         String filename = "Prefix_" + docnum + ".txt";
         conf.put(key, filename);
         return docnum;
    catch (Exception e)
         return docnum;
    In the CC the settings are now as follows
    File Name Scheme = . -> only a dot or something else, because this field is obligatory, even if it is not used in this case.
    Variable substitution (...)
        Enable -> unchecked
    Adapter-Specific Message Attributes
        Use Adapter-Specific Message Attributes -> checked
        Fail If Adapter-Specific Message Attributes Missing -> checked
        File Name -> checked
        Directory, File Type, Temporary Name Scheme for Target File Name -> unchecked
    When I send an IDoc to PI and view the Adapte-Engine Version of the message (the SOAP-document, not the payload) I can find the Filename:
    <SAP:DynamicConfiguration SOAP:mustUnderstand="1">
    <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="FileName">Prefix_0000000000012345.txt</SAP:Record>
    </SAP:DynamicConfiguration>

  • Proxy to file using dynamic configuration

    Hi Frnds,
    I  have a scenario ABAP_Proxy-XI-File, here in the proxy I am getting a pdf file with xml as attachment now I need to save the pdf file to the target folder with the name availble in one of the fields of attached xml file.
    I have used Adapter specific attributes option for filename substitution but getting the follwoing error:
    Attempt to process file failed with com.sap.aii.adapter.file.configuration.DynamicConfigurationException: The Adapter Message Property 'FileName' was configured as mandatory element, but there is no 'DynamicConfiguration' element in the XI Message header
    Please anyone can help me in overcoming this issue.
    Regards
    shiva

    U have a limitation here. At XI u can read only 1 file (pdf or xml). Bcoz receiver file adapter will not support attachment. pdf is required bcoz u need to transfer it to receiver. Xml is also required bcoz the directory name is inside that xml
    The workaround could be creating an adpater module that passes the directory name as well. U should send pdf file with xml as attachment.
    If u have the dir name, then the dynamic configuration code should be like this
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
    conf.put(key,MappedDirectoryName);
    This MappedDirectoryName should be the name passed through payload. The receiver file communiation channel must have dummy dir name
    Regards,
    Prateek

  • Use dynamic configurations inside an abap proxy

    Hi,
    is it possible to set dynamic configurations inside an abap proxy?
    Inside an abap-mapping I can use "CALL METHOD DYNAMIC_CONFIGURATION->SET_RECORD".
    What's up with an abap proxy?
    Regards
    Wolfgang Hummel

    Hi,
    Not Possible.
    Thanks!

  • Receiver File Error while using Dynamic Configuration

    Hi All,
    My Scenario is from SAP IDOC --> PI --> FIle...
    In the mapping i have used the dynamic variable substitution for the receiver file....
    The Dyanamic file will be alwasy generated irrespective of the condition for the Mapping...
    Now Whenever SAP sends IDOC then file to be created . If the condition is met then there is no problem the file is being created...
    But if condition is not met then the error is being thrown in the Communication Channel...
    Error occurred while connecting to the FTP server "10.1.999.222:21": java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'Conversion configuration error: Unknown structure '' found in document', probably configuration error in file adapter (XML parser error)'
    Note the payload has the dyanmic file generated....
    And when i tested the mapping by coping the payload then
    I am getting the target with empty ...but with MT_ProductMaster node...
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_ProductMaster xmlns:ns0="http://xyz/Ix_ProductMaster/WMS"></ns0:MT_ProductMaster>
    and the error i think bcz of this payload ... but i dont have any option to remove this .... because if condition not met then the root node always will be created...
    In CC File  Content conversion i have given like this
    Record setStructure  FileHeader,FileDetail,FileTrailer
    FileHeader.fieldSeparator |
    FileHeader.endSeparator |'nl'
    FileDetail.fieldSeparator |
    FileDetail.endSeparator |'nl'
    FileTrailer.fieldSeparator |
    FileTrailer.endSeparator |
    and my MT structure is
    MT_ProductMaster 1.1
    FileHeader  0...1
    FileDetail 0....unbounded
    FileTrailer 0...1
    Please help me on how to ignore the empty root node... do i need to handle something else???
    Regards,
    Sridhar Reddy

    Hey
    Record setStructure FileHeader,FileDetail,FileTrailer
    FileHeader.fieldSeparator |
    FileHeader.endSeparator |'nl'
    FileDetail.fieldSeparator |
    FileDetail.endSeparator |'nl'
    FileTrailer.fieldSeparator |
    FileTrailer.endSeparator |
    and my MT structure is
    MT_ProductMaster 1.1
    FileHeader 0...1
    FileDetail 0....unbounded
    FileTrailer 0...1
    of course you will get error in content conversion if file is missing any of the parameters expected by FCC.
    Right now the Content conversion is expecting several values in your payload(even if blank values) but you don't have any of them hence you get this error.
    If you want to deliver empty file,you need to map all the receiver side nodes to some default,so that it is populated to that default (could be blank) if no values are present,then when this comes to content conversion,it will assume the blank value as node and do correct conversion.
    If you dont have values in payload but have specified parameters for it on content conversion,then you will get errors as you mentioned in your first post.
    Thanks
    Aamir

  • Using Dynamic configuration

    I have BPM in my scenario with two transformation steps one after the other...what I am trying to do is..
    in first tranformation , I use Mapping Lookup API to fetch a value from RFC and I want to refer this same value in the transformation step 2.
    what I did was,
    1. In the first mapping I use an UDF to fetch the value and put it in the Dynamic Conf.
    String someNumber = // Mapping lookup API Code
    Map param = container.getTransformationParameters();
    DynamicConfiguration conf = (DynamicConfiguration) param.get(
              StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey sharedNumber = DynamicConfigurationKey.create("http://XXXXX/XXX","SNUM");     
    conf.put(sharedGenerationNumber,someNumber);
    2. In the second mapping i then just tried referring this stored value., like
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key =
    DynamicConfigurationKey.create("http://XXXXX/XXX","SNUM");     
    String sharedNum = conf.get(key);
    Is it possible to achive correct result with this?

    Hi,
    >>>>I hope the stored value may not be available for the second mapping. to do this we need to use value mapping ,
    please don't do any inserting to value mapping tables from
    inside your mappings
    values mapping tables are for reading values not for inserting
    from mappings
    Regards,
    michal

  • Using Dynamic Configuration Values in Mapping

    Hi
    I want to use the JMS CorrelationID and MessageID in my mapping
    Can anyone suggest me the UDF which i can use for the this
    I want to get the DynamicConfiguration Values and then map it to the target structure
    Rgds
    Aditya

    Hi Aditya,
    Accessing the Runtime Constants by Using Keys (Special Case)
    In certain exceptional and unavoidable cases, it may be necessary to use the keys to access the fields in the message header. This is always the case when you want to access the contents of the map by means of a variable. In the example below, a variable key key, which is to be used to read a field in the message header, is transferred to a user-defined function of a message mapping. You can only use a variable to access the map if the variable has the name of the key as its value and not the name of the string constant.
    String headerField;
    java.util.Map map;
    // get runtime constant map
    map = container.getTransformationParameters();
    // get value of header field by using variable key
    headerField = (String) map.get(key);
    For example, to read the message ID from the message header, the variable key must have the value MessageId and not MESSAGE_ID.
    Use the below link:
    http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/frameset.htm
    Thanks
    Farooq

  • UDF Using Dynamic Configuration for Counter Reset

    Hi All,
    In an Idoc to file scenario we want to have counter option at the end of the file.we are using NFS so that we wil not face any problem of counter reset on a j2ee restart
    But when the counter turns 999999 it has to be reset to 0000001
    So we are trying to dynamically create a file name using the counter and check whether it has reached 999999 then resetting back . I had written a code for the same but it is throwing an error while mapping and activating.
    UDF CODE is below
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION) ;
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName") ;
    String FileName = conf.get(key) ;
    int inc = 1 ;
    String temp = FileName.substring(10,6);
    String temp1 = FileName.substring(0,10);
    Integer seqNo = Integer.parseInt(temp) ;
    if(seqNo == 0 || seqNo == 999999) {
    seqNo = new Integer(inc) ;
    else {
    int num = seqNo.intValue() + inc ;
    seqNo = new Integer(num) ;
    container.setParameter("seqNo", seqNo);
    String File_Name = temp1 + Integer.toString(seqNo);
    conf.put(key, File_Name);
    return File_Name;
    ERROR it is throwing
    'class' or 'interface' expected public String Decimal$(String Sample,Container container){ ^ /usr/sap/PJD/DVEBMGS58/j2ee/cluster/server0/./temp/classpath_resolver/Map76d12330b43811df8c1500e000a6fabc/source/com/sap/xi/tf/_MM_Sample_to_TRGT_.java:127: 'class' or 'interface' expected }
    So can anyone please advice.

    Hi Stefan,
    I removed the last }
    But stil it is throwing the below error:
    Activation of the change list canceled Check result for Message Mapping MM_Sample_to_Trgt | :  Starting compilation  Source code has syntax error:  /usr/sap/PJD/DVEBMGS58/j2ee/cluster/server0/./temp/classpath_resolver/Map8e67b780b44111dfbc4100e000a6fabc/source/com/sap/xi/tf/_MM_Sample_to_Trgt .java:98: FileName is already defined in File$(java.lang.String,com.sap.aii.mappingtool.tf3.rt.Container) String FileName = conf.get(key) ; ^ /usr/sap/PJD/DVEBMGS58/j2ee/cluster/server0/./temp/classpathresolver/Map8e67b780b44111dfbc4100e000a6fabc/source/com/sap/xi/tf/_MM_Sample_to_Trgt .java:102: incompatible types found : int required: java.lang.Integer Integer seqNo = Integer.parseInt(temp) ; ^ /usr/sap/PJD/DVEBMGS58/j2ee/cluster/server0/./temp/classpathresolver/Map8e67b780b44111dfbc4100e000a6fabc/source/com/sap/xi/tf/_MM_Sample_to_Trgt .java:103: operator == cannot be applied to java.lang.Integer,int if(seqNo == 0 || seqNo == 999999) { ^ /usr/sap/PJD/DVEBMGS58/j2ee/cluster/server0/./temp/classpathresolver/Map8e67b780b44111dfbc4100e000a6fabc/source/com/sap/xi/tf/_MM_Sample_to_Trgt .java:103: operator == cannot be applied to java.lang.Integer,int if(seqNo == 0 || seqNo == 999999) { ^ /usr/sap/PJD/DVEBMGS58/j2ee/cluster/server0/./temp/classpathresolver/Map8e67b780b44111dfbc4100e000a6fabc/source/com/sap/xi/tf/_MM_Sample_to_Trgt .java:111: cannot resolve symbol symbol : method toString (java.lang.Integer) location: class java.lang.Integer String FileName = temp1 + Integer.toString(seqNo);
    Edited by: mallavarapu soundarya on Aug 30, 2010 4:44 PM

  • Target file name using Dynamic Configuration

    Hi,
    Currently we have requirement Idoc to File interface.In this scenario if one field exists infile then we have to check and we need to create update directory and  if it is not exist then we should create one more  directory and upload files over there there files should create with timestamp. Since,File system using Sql database so we have used JDBC lookup to check that particaluar field  and if it exists we are passing update to UDF if it is not then we are passing constant Create to that. If we use Adapter Specific Message Attributes  then in reciever side file Communication Channel addtimestap will it consider or do we have to write anything in Udf it self? Could anybody explain on this?Please provide some sample udf .
    Thanks ,
    Aparna.
    Edited by: aparna_karnam on Dec 24, 2011 11:44 AM
    Edited by: aparna_karnam on Dec 24, 2011 11:52 AM

    Hi,   
            I have added little changes to the code you have written, to meet your expectations
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
    conf.put(key,"/sap-dev/" +a);
    DynamicConfiguration conf1 = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
    string filename=conf1.get(key1);
    final String DATE_FORMAT_NOW = "dd-MM-yyyy_HH-mm-ss";
    String s;
    java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(DATE_FORMAT_NOW);
    java.util.Calendar cal = java.util.Calendar.getInstance();
    s=sdf.format(cal.getTime());
    filename=a+" "+"User_"+s+".txt";
    conf1.put(key1,filename);
    return " ";
    So if value of input variable "a" is "update" then the target directory will be "/sap-dev/update" and the file formed will have name "update User_26-12-2011_01-20-50.txt", of course the date and time values will change depending on server settings. I just showed a sample. one more point, the directory will not be created, you have to create the directories before you run the scenario, only the final directory will be decided depending on value of variable "a". In case you wanna create new directory if directory is not pre-existing then try ticking  on "Create Target Directory" option under "file access parameters" in communication channel. (I have never used this option u can have a try. )
    Now coming to your queries
    1. But whether file type txt automatically it will take or do we have to give in udf it self ?
    ans) You have to put the value in UDF as I have done in code.
    2.    how it will consider timestamp ?
    ans) This has been generated in UDF itself.
    3.  how i can give file extension .txt?
    ans) same as ans 1
    4. And also in Receiver Communication Channel under Adapter Specific Message attributes we have option of file type how it works?
    ans) File type determines is the file you are going to write is of type "text" or "binary". From "Processing Parameters" tab you can select this from drop down menu in communication channel or you can set it through ASMA properties in similar manner as you have done for file name and directory name. For more details refer to http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    http://help.sap.com/saphelp_nwpi71/helpdata/en/44/6830e67f2a6d12e10000000a1553f6/content.htm
    Finally few more points I would like to add
    1) you have  not mentioned the operating system of the server where file is going to form. In case its UNIX/LINUX you are not allowed to use space in the filename. you can consult these links before you decide on file name and directory name in the UDF mentioned above
    http://www.med.nyu.edu/rcr/rcr/nyu_vms/unixfileanddirectorynames.htm     (UNIX)
    http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#naming_conventions  (WINDOWS)
    2) you can alter the string "DATE_FORMAT_NOW" as per your requirement so  that the timestamp appears in the way you want. I have just showed a sample.
    3) Plesae do not forget to tick on the options "Use Adapter-Specific Message Attributes indicator", "Fail If Adapter-Specific Message Attributes Missing", indicators "File Name" and "Directory" under "Define Adapter-Specific Message Attributes." in receiver communication channel.
    Hope this solves your problem.
    Wish my dear forum members and users of SDN
    Merry Christmas and Happy new year (in advance)
    Regards
    Anupam
    N.B:- I initially forgot to add the ".txt" part to the file name. I made necessary corrections in code now.

  • Setting JMSMessageID using dynamic configuration

    hi all,
    I have a scenario where i need to set JMSMessageId with some value from the payload.
    I tried setting JMSMessageId  using the setproperty but the message id was not set in the jms message.
    If any one has tried the same let me know wat is the settings that needs to be done in the receiver JMS channel.
    Thanks in advance!!
    regards,
    Rajesh

    > I have a scenario where i need to set JMSMessageId with some value from the payload.
    > I tried setting JMSMessageId  using the setproperty but the message id was not set in the jms message.
    setStringProperty will work only for hard coded values as per my experience. So messageId will not work here..
    > If any one has tried the same let me know wat is the settings that needs to be done in the receiver JMS channel.
    I have never tried, you can try it under Adapter Specific Message Attributes by ticking the "Specify Additional JMS Message Properties".
    Here in the table under "Name" enter "DCJMSMessageProperty0" and "Java Type" as "String".
    Now in your mapping you have to write an UDF. The UDF should not have any input arguments, I mean while creating the udf just delete the default argument 'a'.
    UDF Code:
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/JMS","DCJMSMessageID");
    DynamicConfigurationKey key2 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/JMS","DCJMSMessageProperty0");
    String MyMessageID = conf.get(key1);
    conf.put(key2, MyMessageID);
    return "";
    Just map this UDF to any root/parent node to fulfil the mapping.
    Note: I have assumed that your sender channel is JMS. In your Sender channel also you have to tick "Adapter Specific Message Attributes" and under that select "JMS Message ID".
    Save and activate the changes.. Try it and let me know..
    Regards,
    Sarvesh

Maybe you are looking for