Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • TREP APIs /
avatar image
Question by hamza.khalid · Jun 12, 2020 at 04:41 PM · rfarfac++

Not getting closure in the messages

Hey, I am registering the symbol with one thread but processing is happening in another thread. In this case I dont get the closure back which is precisely the ItemName.

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 zoya.farberov · Jun 12, 2020 at 06:00 PM

Hello @hamza.khalid,

Pass your closure as parameter into registerClient, per Developer Guide:

"... registerClient() on an OMM consumer or provider object. This method accepts

up to four parameters.

• The first parameter (pEventQueue) is a pointer to the event queue.

• The second parameter (ommItemIntSpec) is an interest specification.

• The third parameter (*this) is a client (i.e., the application callback that receives the dispatched events).

• The fourth parameter is a closure, which is a pointer to some opaque data supplied by the application. For more information about closures, refer to Section 6.4.1.6...."

Hope this helps, however, if you are getting started with RFA C++, would suggest to first work through RFA C++ Quickstart and RFA C++ Consumer Tutorials to save you time, effort and usually improving on the overall learning experience.

If this is a new app, consider designing and implementing it with our latest API Suite Elektron, EMA C++ API.


Comment
hamza.khalid

People who like this

1 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
hamza.khalid · Jun 12, 2020 at 06:05 PM 0
Share

Hey,

I know how to use the API and the register client has 4 parameters I am sending closure as (void*) itemName. The problem is I am not receiving the closure back in the callback. Can you help me with that


Thanks

avatar image
REFINITIV
zoya.farberov ♦♦ hamza.khalid · Jun 12, 2020 at 06:35 PM 0
Share

Hello @hamza.khalid,


In the framework of the discussion forum, when developers can have very different levels of familiarity with API, we try to answer any question in a way that will provide most help to the community. This is why I've discussed how to pass the closure.

This forum is designed for and can be most helpful for general questions and discussions centered around Refinitiv APIs.

The answer depends:

For me, the simplest way to make sure you are coding with Closure correctly, in my opinion, is to take a simple example that came with SDK (StarterConsumer, Consumer), single-threaded, pass closure on registerClient and confirm if you get it back properly in the callback.

If you do, then something else you do with threading is wrong, not the closure pass and retrieve.

If you don't, please include your specific registration code excerpt, we can take a look at how you are passing the closure. In the callback we can also take a look at the specific call, how you are retrieving the closure.

If rather you are looking for someone to be assigned and to take in-depth review of your code, that kind of requirement is not handled over discussions forum, but can be done over Premium Support channel. I could not find your organization on Premium support clients list, if I did not miss anything (sometimes it's under a different name after a re-org) and this is what you are looking to do, please discuss signing up for Premium Support with your Refinitiv account team.


avatar image
REFINITIV
Answer by zoya.farberov · Jun 13, 2020 at 04:51 AM

Hello @hamza.khalid,

You are correct, the intention with setting of Closure is to be able to receive it with received Events. And making requests from one Thread while receiving in another should not be a problem.

Can think of two things that may be helpful:

Section "Event Distribution Usage Guidelines" of RFA Developers Guide discusses good practices, as well as what not to do. Perhaps worth reviewing, and maybe you can come up with what you are doing wrong.

The other is ConsPerf that can be found in PerfTools folder of RFA SDK, it may be a good example to review, this is a threaded example built to test and tune performance, and registerClient is called from one thread, while processRespMsg is in another. It passes Closure of itemName. As a sanity check, I have just added printing Closure to processRespMsg (in different thread) and I see the closure printed as expected.

Comment

People who like this

0 Show 0 · 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.

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 >
9 People are following this question.

Related Questions

Which TREP version starts to support OptimizedPauseResume in RFA?

In RFA and UPA, can we check if the time field contains high precision timestamp before decoding? (from MiFID II Webinar Sep 27)

Using RFAJ Non-Interactive Provider to provide Record Augmentation

Proper behavior for an interactive provider upon loss of upstream communication

Publishing my application version to TREP

  • Feedback
  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Careers
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Calais
  • 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
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • 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
  • TRIT
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • World-Check Data File
  • Explore
  • Tags
  • Questions
  • Badges