Question about the TRB feed

We have a question about the TRB feed. Right now, we receive both D4 and TRB on the same session, how we can differentiate if a message is D4 or TRB besides the symbol name?

Right now, in each reuters msg, there is a "NameFlag" Attribute, we see "INR=D4" and "INR=TRB" respectively. But is there a better way to differentiate them rather than comparing symbol name? such as if they are different in other AttribInfo field?

Best Answer

  • wasin.w
    wasin.w admin
    Answer ✓

    Hi @george.sommerfield

    Which Elektron API that you are using?

    If you are using EMA Java API, you can get the service name of incoming OMM message from Elektron/TREP via .serviceName() attribute.

    Example Code:

    public void onRefreshMsg(RefreshMsg refreshMsg, OmmConsumerEvent event)
    {
    if (refreshMsg.hasName())
    System.out.println("Item Name: " + refreshMsg.name());

    if (refreshMsg.hasServiceName())
    System.out.println("Service Name: " + refreshMsg.serviceName());
    ...
    }

    public void onUpdateMsg(UpdateMsg updateMsg, OmmConsumerEvent event)
    {
    if (updateMsg.hasName())
    System.out.println("Item Name: " + updateMsg.name());

    if (updateMsg.hasServiceName())
    System.out.println("Service Name: " + updateMsg.serviceName());
    ....
    }

    Example Result:

    Item Name: EUR=
    Service Name: ELEKTRON_DD

    .....
    Fid: 22 Name: BID value: 1.2331
    Fid: 393 Name: PRIMACT_1 value: 1.2331
    Fid: 25 Name: ASK value: 1.2335

    ....

    For you references, please see more detail regarding parsing and decoding incoming data in the following Elektron SDK tutorials: