Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Elektron /
  • EMA /
avatar image
Question by he.wu · Jun 28, 2021 at 09:19 AM · elektronrefinitiv-realtimeelektron-sdkrrtema-apic++OMMconsumer

EMA C++ can not pass a OmmArray to OmmConsumerClient

I create a class who inherited the OmmConsumerClient, and I pass a OmmArray to the construction function in order to decode the fids that I want

RefinitivClient::RefinitivClient(const OmmArray & fids)

: m_fids(fids)

{

}


void RefinitivClient::decode(const refinitiv::ema::access::FieldList & fl)

{

ElementList search;

search.addArray("test", m_fids.complete()).complete();

}

It will charge all of the fids

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

2 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by Jirapongse · Jun 29, 2021 at 04:46 AM

@he.wu

I have tested it with the Cons120 example in the RTSDK-2.0.1.L2.win.rrg package. The main function contains the following code.

OmmArray fidArray;
        fidArray.fixedWidth(2).addInt(22).addInt(25).addInt(30).addInt(31).addInt(3);
        
        AppClient client(fidArray);
        OmmConsumer consumer(OmmConsumerConfig().host("localhost:14002").username("user"));
            
        consumer.registerClient( ReqMsg().serviceName( "ELEKTRON_DD" ).name( "JPY=" ), client );

The decode function contains the following code.

void AppClient::decode( const FieldList& fl )
{
    ElementList search;


    search.addArray("test", m_fids.complete()).complete();
    while (fl.forth(search))    {
        const FieldEntry& fe = fl.getEntry();
        cout << "Filter Fid: " << fl.getEntry().getFieldId() << " Name: " << fl.getEntry().getName() << " value: " << fl.getEntry().getLoad().toString() << endl;
    } 
}

The output contains the required fields.

1624941943808.png


1624941943808.png (30.4 KiB)
Comment

People who like this

0 Show 2 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
he.wu · Jun 29, 2021 at 08:37 AM 0
Share
@jirapongse.phuriphanvichai


excuse me, could you give me your constructor function of your AppCLient ?


avatar image
REFINITIV
Jirapongse ♦♦ he.wu · Jun 29, 2021 at 08:42 AM 0
Share
AppClient::AppClient(refinitiv::ema::access::OmmArray& array) :m_fids(array) 
}


class AppClient : public refinitiv::ema::access::OmmConsumerClient
{
public :
    AppClient(refinitiv::ema::access::OmmArray& array);    
    refinitiv::ema::access::OmmArray& m_fids;
avatar image
REFINITIV
Answer by nick.zincone12 · Jun 28, 2021 at 03:11 PM

Hi @he.wu,

I'm not clear on what issues you are facing or what you are trying to do. Within your decode, you typically walk through the fieldList that is passed and pull out the data. Within your code segment, you don't appear to be processing the incoming fieldList, but instead creating an ElementList. Can you provide more detail?

Comment

People who like this

0 Show 3 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
he.wu · Jun 28, 2021 at 03:51 PM 0
Share

hi @nick.zincone

tks for your return, in fact, I pass a OmmArray which contains all the fids that I need for the construction of OmmConsumerClient.

And then, when I receive the notif of refinitiv, I will decode it, but I can not filter the notif by the OmmArray

void RefinitivClient::decode(const FieldList& fl)

{

ElementList search;

search.addArray("test", m_fids.complete()).complete();

while (fl.forth(search))

{

const FieldEntry& fe = fl.getEntry();


cout << "Name: " << fe.getName() << " Value: ";

}

}

in my code, normally, it will only deocde the fids contains in OmmArray, but it still decode all of fids

avatar image
REFINITIV
nick.zincone12 he.wu · Jun 28, 2021 at 05:00 PM 0
Share

Hi @he.wu,

You provided an explanation of your code walkthrough, but what would be more helpful is to describe what you are trying to achieve. Based on what I can tell, is you are subscribing to an instrument that will return all fields and you are only interested in a few of those fields and are attempting to figure out how to filter the ones of interest?


avatar image
he.wu nick.zincone12 · Jun 29, 2021 at 08:18 AM 0
Share
hi @nick.zincone

yes, that it what i want to do, I just want to decode the few fids that I'm interested

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
6 People are following this question.

Related Questions

Invalid attempt to close batch stream. Exception thrown in thomsonreuters::ema::access::OmmInvalidUsageExceptionImpl

The relationship between consumer channels and consumer events

Contribute more than a RIC via EMA C++ (RCC)

EMA c++ iProvider onPostMsg, how to update values from the post message.

When does a handle returned by thomsonreuters::ema::access::OmmConsumer::registerClient become invalid?

  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • FX Venues
    • FX Trading – RFQ Maker
  • Intelligent Tagging
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open Calais
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • RDMS
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • Workspace SDK
    • Element Framework
    • Grid
  • World-Check Data File
  • Yield Book Analytics
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges