question

Upvotes
Accepted
5 2 2 4

Create RIC in ATS

Hi, I am developing an OMM posting consumer to contribute into an ATS. If the item was configured in ATS (1.5) in advance, this works fine, ATS delivers initial Image and Updates to consumers.

But if I contribute to a RIC that wasn't set-up, the contributions Show in the ats.contrib files but the RIC cannot be consumed as it is indicated as not existing. In the ATS documentation I have found, that a static contribution RIC can be inserted from Eikon Excel by contributing to a Special RIC ATS_INSERT_S with the desired RIC Name in FID -1.

I have tried to encode such OMM Message but the ATS does not react. The respective ATS configuration flag ENABLE_INSERT_CONTRIB ist set to TRUE.

Does anyone have a working example for this use case?

treprfarfa-apiOMM
icon clock
10 |1500

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

Monitored by @Pimchaya.Wongrukun

Hi @f.heuschen

Thank you for your participation in the forum.

Does any of the replies below answer to your question?

If yes please click the 'Accept' text next to the most appropriate reply. This will guide other community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

AHS

Upvote
Accepted
9.6k 10 7 7

Hello @f.heuschen

You can use RFA Java application to create a RIC on ATS by sending a refresh message.Please follow the steps below that modify StarterConsumer_Post example in <RFAJ package>\Examples\com\reuters\rfa\example\omm\postingConsumer to insert a RIC to ATS:

1. Modify post_input.txt to set payload=refresh_msg, name=ATS_INSERT_S and type=offstream as below:

name=ATS_INSERT_S service=API_ATS1_4 userRightsMask=create type=offstream part=single id=true sequence=false ack=true attrib=attribInfo payload=refresh_msg payloadMsgPayload=data

Note: service=API_ATS1_4 is our ATS service, you have to change to your ATS service.

2. Modify PostItemManager.createPayloadOMMMsg(PostInfo) to specify the new RIC name and its data. In this example, we create a RIC named NEW.BK with field BID(field Id 22) and ASK(field Id 25) value 200 and 205 respectively. Notice that the RIC name is specified with the FID -1 (X_RIC_NAME).

if (payloadDataType == OMMTypes.FIELD_LIST)
{
// ***** Payload : Field List - Start ***** //
    _payloadOMMEncoder.encodeFieldListInit(OMMFieldList.HAS_STANDARD_DATA,
(short)0,(short)1, (short)0);
//add RIC
   _payloadOMMEncoder.encodeFieldEntryInit((short)-1, OMMTypes.ASCII_STRING);
    //set RIC name NEW.BK
   _payloadOMMEncoder.encodeString("NEW.BK", OMMTypes.ASCII_STRING);  
    //Bid field
    _payloadOMMEncoder.encodeFieldEntryInit((short)22, OMMTypes.REAL); 
    //set value 200
   _payloadOMMEncoder.encodeReal(200, OMMNumeric.EXPONENT_0 );   
    //Ask field
    _payloadOMMEncoder.encodeFieldEntryInit((short)25, OMMTypes.REAL);
    //set value 205
   _payloadOMMEncoder.encodeReal(205, OMMNumeric.EXPONENT_0 );   
   _payloadOMMEncoder.encodeAggregateComplete();
    // ***** Payload : Field List - End ***** //
 }

3. Compile and run the application with -openItemStreams and -sendPostAfterItemOpen is false for off-stream posting (since no item stream is required as the posting will be done through the login stream)

java -cp ..\Libs\rfa.jar;D:\rfaj8.0.1.E3.all.rrg\Examples com.reuters.rfa.example.omm.postingConsumer.StarterConsumer_Post
-debug true -session myNamespace::consSession –enumType D:\rfaj8.0.1.E3.all.rrg\etc\RDM\enumtype.def -rdmFieldDictionary D:\rfaj8.0.1.E3.all.rrg\etc\RDM\RDMFieldDictionary -runTime 60 –postInputFileName D:\rfaj8.0.1.E3.all.rrg\Examples\com\reuters\rfa\example\omm\postingConsumer\post_input.txt -openItemStreams false -sendPostAfterItemOpen false

The example output if the RIC is created on ATS successfully.

    For details of each application's parameter, refer to<RFAJ package>\Examples\com\reuters\rfa\example\omm\postingConsumer\package.html


    icon clock
    10 |1500

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

    Upvotes
    25.3k 87 12 25

    Hi @f.heuschen

    I wrote some code to do this a while back - which I can share a snippet of, with you below.

    NOTE: This was with a slightly older version of ATS and I am not currently in a position to test my old code, but I will share in case it helps:

    void InfoRecord::populatePostMsg(PostMsg &postMsg, const RFA_String & ticketID, const RFA_String & postSvcName)
    {
    	_attribInfo.clear();
    	_attribInfo.setNameType( rfa::rdm::INSTRUMENT_NAME_RIC );
    	_attribInfo.setName ( RFA_String("ATS_INSERT_S", 0, false) );
    	_attribInfo.setServiceName( postSvcName );
    	postMsg.setAttribInfo( _attribInfo );
    
    	_flWiter.start( _fl );
    	_fe.clear();
    	_fe.setFieldID(-1); // Record Name for ATS_INSERT_S
    	_dataBuffer.setFromString(_itemName,DataBuffer::StringAsciiEnum);
    	_fe.setData(_dataBuffer);
    	_flWiter.bind(_fe);
    	
    	// setup LATESTID field
    	_fe.clear();
    	_fe.setFieldID(LATESTID); // LATESTID
    	_dataBuffer.setFromString(ticketID,DataBuffer::StringAsciiEnum);
    	_fe.setData(_dataBuffer);
    	_flWiter.bind(_fe);
    	
    	//
    	// bind more fields
    	//
    	_flWiter.complete();
    	postMsg.setPayload( _fl );
    }

    As mentioned I am not able to test the above at this point, but hopefully it may help.

    icon clock
    10 |1500

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

    Write an Answer

    Hint: Notify or tag a user in this post by typing @username.

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