Can we use EMA Consumer example to read Ticket Output Feed?

What are the parameters we need to pass in the following code snippet?

What we are trying to read is complete deal info to java code,

<FS>332<US>tag<GS>TCID # INFO<FS>

consumer.registerClient( EmaFactory.createReqMsg() .serviceName("ELEKTRON_AD") .name("BB.TO"), eventHandler );

Can someone please help on this? Am looking for an example for Reading Ticket Output Feed. Please help

Best Answer

  • Jirapongse
    Jirapongse admin
    Answer ✓

    EMA Java can be used to retrieve real-time data from ELEKTRON service (ELEKTRON_AD). Please see the sample market price data for BB.TO in the attached file (data.txt). The data is in field list. I couldn't find Ticket Output Feed in the returned field list.

    For Ticket Output Feed, it could be from Transaction Product, such as Dealing. <FS>332 is not used by real-time data.

    You should contact your Thomson Reuters account team for further assistance regarding TOF or contact the Dealing support team via http://my.thomsonreuters.com/ContactUsNew

Answers

  • Hi @varma

    Reading between the lines, I am guessing that you want code to subscribe to the DealTicket TCID#INFO record and then consume each new ticket that is issued on the Dealticket #INFO record.

    Firstly, I recommend you work through the first few steps of our EMA Java tutorials - up to the step 'EMA Consumer - Parsing and Decoding MarketPrice data' - to get a basic understanding of how EMA Consumer works.

    You will note in the tutorial that you call registerClient with the RIC that you wish to subsrcibe to.

    OmmConsumerClient infoEventHandler = this;
    consumer.registerClient(
    EmaFactory.createReqMsg()
    .serviceName("ELEKTRON_AD")
    .name("TCID#INFO"),
    infoEventHandler );

    This will result in the OnRefreshMsg invoked initially and then OnUpdateMsg invoked as and when new DealTicket records are generated on TOF.

    From the OnRefreshMsg and OnUpdateMsg you would then call the decode method which iterates through the FieldList and extracts the LATESTID field (as well as others you require). Each time you get a new LATESTID field you would then call registerClient again - using the LATESTID as the RIC code - but this time you would only want a snapshot - not a streaming request so you would set the interestAfterRefreshFlag to false

    consumer.registerClient(
    EmaFactory.createReqMsg()
    .serviceName("ELEKTRON_AD")
    .name(latestTicketID)
    .interestAfterRefresh(false), //snapshot
    _ticketEventHandler );

    NOTE the following:

    • I am guessing the field that contains the new TICKET number is LATESTID - it could be a different Field
    • I have used ELEKTRON_AD as the servicename - yours may well be different e.g. DEALING_DATA?
    • Note that I am using two different OmmConsumerClient instances - each with its own implementation (not shown) - infoEventHandler and _ticketEventHandler
    • You could use the same OmmConsumerClient instance (and implementation) - but using one to implement the code for handling #INFO records and one to implement the code for handling your Ticket records will make the code cleaner.