question

Upvotes
Accepted
16 1 1 2

posting to a FID using starterconsumer_post

Hi I am trying to use the example code (starterconsumer_post) from java API version 8.0.0.L2 to post to a FID for a test instrument that has been created in our ATS service. I understand there is an optional (command line driven) text file that setup the post (post_input.txt) . You can use this file to specify the service name, the instrument and a load of other parameters. However there are no details of how to specify the FID in this file or in any of the documentation. I managed to work through the java code and found where to hack the fid. It is in the postitemmanager.java file under the createPayloadOMMMsg stanza.

Did I miss something ? Do you have details on targeting a post to a FID ?

elektronrefinitiv-realtimetrepposting
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
Accepted
9.5k 10 5 7

Hello @graham.street

Unfortunately, RFA does not provide any method to encode data with the FID name and value directly.You need to use encodeFieldEntryInit() which requires the field ID and the data type:

void encodeFieldEntryInit(short fid, short dataType)

Then uses encodeXXX(data) method to encode data e.g. encodeReal(long longValue, byte hint), encodeUInt(long value) according to dataType parameter specified in encodeFieldEntryInit(..) method. Anyway, you can find the FID number and its type according to the FID name in [rfaj8.0.0.L2 package]\etc\RDM\RDMFieldDictionary. They are the field FID and RWF TYPE column respectively.

In additional, RFA Java is a complete feature API that means there are no any changes in the current methods and no new methods(enhancement requests are not accepted). Hence, you need to use the existing methods which I have explained previously.

Apart from RFA, Thomson Reuters provides a strategic API named Eleketron Message API(EMA) which is one API in Elektron family APIs . EMA is ease of use and very less line of code comparing to RFA(reduce more than 50%). For details how to post data to ATS using EMA, please refer to

Implementing Elektron API applications to work with ATS - Part 1

Implementing Elektron API applications to work with ATS - Part 2

In additional, you can raise an EMA enhancement requests to the development team directly via https://github.com/thomsonreuters/Elektron-SDK

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
9.5k 10 5 7

Hello @graham.street

For the required information i.e. RIC, fields, server, service, username to be used to post data, please contact your local market data team/server’s admin(if the server is owned by your company) or Thomson Reuters Account team(if the server is owned by Thomson Reuters).

Once you have the required info, you can start post FIDs for updating their values on ATS using StarterConsumer_Post application by following the steps below

1)Modify post_input.txt as below. Please change name and service to be your RIC and your service respectively while other parameters should be set as below.

name=NEW.RIC service=API_ATS1_4 type=offstream part=single sequence=false id=true UseRefreshLock=false ack=true userRightsMask=create attrib=attribInfo attribData=false payload=update_msg payloadMsgAttrib=attribInfo payloadMsgAttribData=false payloadMsgPayload=data

I have also attached the file: post-input.txt

Before using the file, change name and service to be your RIC and your service.

Note: The RICs and their fields that you can post must be available in ATS already.

2)Specify your posted data under if (payloadDataType == OMMTypes.FIELD_LIST) of createPayloadOMMMsg(PostInfo postInfo) in PostItemManager.java. For example to post field BID(field Id 22) and ASK(field Id 25) with value 100 and 105 respectively:

if (payloadDataType == OMMTypes.FIELD_LIST)
   {               
      // ***** Payload : Field List - Start ***** //
      _payloadOMMEncoder.encodeFieldListInit(OMMFieldList.HAS_STANDARD_DATA,(short)0, (short)1, (short)0);
      //Bid field
      _payloadOMMEncoder.encodeFieldEntryInit((short)22, OMMTypes.REAL); 
      //set value 100
      _payloadOMMEncoder.encodeReal(100, OMMNumeric.EXPONENT_0 );   
      //Ask field
      _payloadOMMEncoder.encodeFieldEntryInit((short)25, OMMTypes.REAL);
      //set value 105
      _payloadOMMEncoder.encodeReal(105, OMMNumeric.EXPONENT_0 ); 
      _payloadOMMEncoder.encodeAggregateComplete();     
     // ***** Payload : Field List - End ***** //
   } 

3)Compile. Then, run StarterConsumer_Post at <RFAJ package>\Examples using the following command line to post data. Just change -cp, session, rdmFieldDictionary, enumType and postInputFileName to yours and other parameters should be set as below.

java -cp D:\rfaj8.0.0.L2\Examples;D:\rfaj8.0.0.L2\Libs\rfa.jar com.reuters.rfa.example.omm.postingConsumer.StarterConsumer_Post -debug true -session myNamespace::consSession -rdmFieldDictionary D:\RDMFieldDictionary -enumType D:\enumtype.def -runTime 120 -postInputFileName D:\post_input.txt -openItemStreams false -sendPostAfterItemOpen false

For details of each application's parameter, please refer to package.html in the application' s source code folder.

If the application posts data successfully, it should receive a positive acknowledgement and print the message like below:


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
16 1 1 2

Thank you

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
16 1 1 2

I want to write a tool to contribute/post data to an ATS RIC. I learnt that you need to not only need to know the FID number and name but also the type of data that the fid is setup in. So somehow the tool needs to be able to take in a command line parameter as a FID number and value, then check that the value is in line with the FID type before post out. The current issue is how to pass through the FID name and value through to the payloadencoded stanza.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
16 1 1 2

Thank you for your advice

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
20.3k 73 10 20

Hi @graham.street

If you are able to connect to an ADS v3.2 at your site then you could consider using the Websocket API.

It wont fully solve the issue you are facing but it may makes things a bit easier for you...

Because it uses a JSON payload to send the Post message, you can use Field Names - rather than FIDs. You still need to know the field's data type e.g. if you are posting to numeric field the value has to be specified as a numeric value (without ' or " quotes).

 "Fields": {
      "DSPLY_NAME", "MY TEST",
      "BID": 45.55,
      "BIDSIZE": 18,
      "ASK": 45.57,
      "ASKSIZE": 19
    }

So, for example in the above extract from a Post request the fields section has a mixture of String, Price and Integer fields that I am posting values to.

If I were to use "45.55" or '45.55' for the BID value it would be rejected.

Please see the Websocket API page for further details - from the Download tab, you can download the Interactive documentation - which details the JSON message formats for Login, Request, Post etc - as well as a Sample applications download which covers various programming languages.

I hope this helps...

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Umer Thank you for your advice .

Upvotes
16 1 1 2

In a way I am happy to read these replies. It shows I am not missing anything and I will need to add some coding around taking in a fid, data pair and passing it to the relevant function in the example code.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea