question

Upvotes
Accepted
185 6 12 25

ClearCacheFlag and RefreshCompleteFlag in Unsolicited Refresh message

Hello, I am using RFA 8.1 API's with MarketByPrice domain. I few doubts about ClearCacheFlag and RefreshCompleteFlag

1. If I want to know indication mask in Refresh message, should I use RespMsg::getIndicationMask or Map::getIndicationFlag?

2. What is the correct order of receiving Clear cache and Refresh complete? When I print indication mask, it first prints out "4" followed by "6". So which indication flags are set in it?

3. I expect to receive previously existing order id with INSERT instruction only after Clear cache is processed, isn't it correct?

4. In all documentation that I have, it states to refer "RFA C++ Reference manual" for more details, where I can find it?


c++OMM
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.

Hello @mktdata ,

Thank you for your participation in the forum.

Is the reply below satisfactory in resolving your query?

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

Thanks,

-AHS

Hello @mktdata ,

Please be informed that a reply has been verified as correct in answering the question, and marked as such.

Thanks,

-AHS

Upvotes
Accepted
32.2k 40 11 20

Hello @mktdata,

Please be informed that per PCN 12072, shared on 31 Jul 2021, RFA 8.1 is on limited support.

Please refer to your copy RFA C/C++ 8.1 SDK, complete with examples and documents.

1. I would suggest to process as in example Consumer included with SDK in folder Examples, method LevelTwoClient::processRefreshRespMsg

if ( respMsg.getIndicationMask() & RespMsg::RefreshCompleteFlag )
text += RFA_String( "RefreshComplete flag received.\n", 0, false );

RefreshCompleteFlag is of type InidicationMask:

enum IndicationMask
{
...
RefreshCompleteFlag = 0x8,/*!< indicates that the message is the final refresh. this flag is set on single part refreshes as well as on the last part of the multi part refresh */
...
};

2. I do not believe, that the order of receipt of ClearCache and RefreshComplete is guaranteed per and the two should be handled as coupled.

ClearCacheFlag = 0x4,/*!< indicates that the cache should be cleared. This condition occurs if the data is known to be invalid. */

The processing should be per single received guidance. Yes, for the most part, the clear cache is expected to be followed by Refresh that comes with RefreshComplete. However, on the chance that you get a ClearCache that is not immediately followed by a Refresh, the two should be processed independently in code, and a production-strength app should be able to handle this scenario.

3. Are you consuming from Refinitiv Real-time service, or from a custom published? Are you observing a different sequence on your side?

After the initial Refresh, we can see Update messages, with Add, Update and Delete actions. I would not couple ClearCache with any Refreshes or Updates.

4. Included with RFA SDK, you should see folder Docs, and in it index_classic.html. If opened in browser (I use Chrome), you should see menu Documentation -> Reference Manual.

rfaref.gif

Or in Docs folder, you should see a folder named "refman".

---

If you are designing a new application, or making extensive changes to the existent one, we highly recommend integration with our strategic APIs that are part of Refinitiv Real-time SDK suite, rather then with RFA. Please refer to article Migrating from Refinitiv Legacy to Strategic APIs for helpful guidance, more detailed information can be found in the links included within the article.


rfaref.gif (26.8 KiB)
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.

Hello @zoya faberov , thanks for your response. Point 3 is still not clear to me. Let me explain the situation with example. Lets say after 3 hours of initial subscription, I received unsolicited Refresh with RefreshCompleteFlag SET and ClearCacheFlag NOT SET. When unsolicited refresh was received, there was order with id "29.440B" in the system. The refresh message carried an "Add" instruction with same order id "29.440B". Now this is the problem. Since that order id was already present in the system, I didn't expect "Add" instruction with pre existing order id until and unless we have got refresh with ClearCacheFlag indication flag SET previously.

Answers to your questions

1. Yes I am consuming from Refinitiv Real-time service,

2. Yes I am observing a different sequence as explained above

Upvotes
32.2k 40 11 20

Hello @mktdata ,

I understand question 3 better now.

According to RDM Usage Guide, in MarketByPrice-> Refresh message IndicationMask ClearCacheFlag is optional:

clearcacheflag.gif

If IndicationMask ClearCache is set, we have to follow the guidance, and to clear cache.

If it is not set, the action is up to the designer.

One can clear cache, prior to applying, as Refresh is intended as complete and self-sufficient state of the order book, despite being often conveyed in multiple messages.

We can potentially run into corner cases, when an order was filled or partially filled, while the multi-part refresh was in transit, and will get a DELETE or UPDATE on that order within REFRESH. In this case, would apply to the local order book the latest known state.

The alternative is not to clear, and to re-create order book in place, matching and overwriting the previous orders with the new received ADDs, that is also a valid approach and should work.


clearcacheflag.gif (36.4 KiB)
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.

HI @zoya faberov ,

Thank you for the reply, But here I have further doubts
1] If we follow the alternative in your last line of the answer and start overwriting the previous orders, can there be a case when all the levels are not overridden and we keep on having stale(not overridden) levels.
For example, If we have 10 levels currently in the local book and we receive ClearCache instruction. Now we start overriding the orders with newly received ADDs but in the update if we receive only 8 ADDs instead of 10. Then previously existing 2 levels will still be present in the updated book.
Is this scenario valid if we take your alternative approach?

2] If we handle the clear cache successfully, how can we test this?
If we are testing symbols VOD.L or OREP.PA, when can we expect refinitiv to send us the clear cache instruction?

Hi @mktdata,

1. I agree with you- the second approach is more complexity, and will need to take this into account, match and overwrite what is present, remove anything not present, and add anything that is new.

2.

  1. From my limited testing- clearCache indication was present on Refresh.
  2. I could not find any information in documentation, about it being mandatory.
  3. As I see it documented as optional, I would design with understanding that the indication- is optional.

In addition to live testing, or if your required market of hours do not match well with your local time zone, you may wish to record data with Infra tools, and replay data for testing. Infra Tools can be downloaded from Refinitiv Realtime SDK -> Downloads or also from My Refinitiv -> Software Downloads

Hope that this information is of help

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.