question

Upvotes
Accepted
21 1 3 4

C# Sample L1 app - Are multiple CacheControls required?

I was just looking at the L1 sample app trying to figure out why my app can get Positions and Orders fine, but not L1 quotes.. I've noticed a few things which seem odd in the sample, could someone please help?

1. There are multiple CacheControl objects being created (6 to be specific), is this necessary? Couldn't one cache control object (It's basically an in memory table right?) have all of the quotes, one per row?

2. Main is calling Submit() only on the first CacheControl object in the list via this line:

myL1.QuotesDict[myL1.myInstrumentList[0]].Submit();

That seems quite wrong considering there are 6 CacheControl objects. (I checked, they each have a different hashcode)

3. Does the where clause on CacheControl.Submit (second parameter) matter? It's empty string in the example, but "true" (as a string) in sample in the documentation.

4. Is there any documentation on the error codes from these various calls? On a user machine I got an error 4, but don't know what was going on at the time with his machine, and I'm not about to guess what 4 means without some help.

5. Can someone fix the L1 sample app so it actually compiles?

Thanks,

Peter

Also, I'm getting a result of false and an error of 5 when I call CacheControl.Submit as:

object result = Cache.Submit("L1", string.Empty, ref error);

Can you please provide some clarity on the error codes?

-Peter


c#redi-apicaching
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.

@peter.drier

Thank you for your participation in the forum. Were you able to confirm that applying API related entitlement addressed the issue you experienced? If yes, would you clicking Accept link next to the last response provided on this thread? It would help other users who may experience similar issue in the future. Otherwise, please update this thread with any observations or findings since the entitlement was applied to the affected user account.

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

Upvotes
Accepted
32.2k 40 11 20

Hi Peter @peter.drier,

REDI team has concluded their investigation into this:

"the user was missing an API related entitlement, it was applied, and they should be set now".

Please ask the user to re-test, and confirm?

Thanks

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.

Yes the entitlement issue was fixed. Though anyone looking at this thread should clearly be able to see many other issues at hand here which were not fixed.

From my point of view, there was a lack of motivation to fix the public facing client side of this api. The documentation and demo apps logically conflict with each other, and more time was spent deflecting work to improve the situation than to fix the situation outright. This baffles me, and I certainly won't be recommending Redi to any future clients from a technical standpoint.

Upvotes
32.2k 40 11 20

Hello @peter.drier,

Let me try to help.

1. The usage, as demonstrated per example, is working, per current product COM interface. An example has to mirror the interface that is exposed. Unable to do something different.

2. No, to "only on the first" question, but you are correct in that Submit is called once. This submit call starts realtime subscription. All previously added watches (on instruments) will be submitted at this time.

3. It can. Not in this example and usually not in L1. Please see Order Monitoring example for valid usage:

where = "(msgtype == 10)"

4. I can not be extremely helpful here, but will give you as much info as I can:

  • 4 = cache error ( I know this is very broad)
  • 5 = query error. I.e. the query that was submitted was not valid

You can submit a documentation enhancement request with the assistance of your Refinitiv account manager, so that it can be prioritized.

5. I do not experience the issue compiling the example and can not seem to reproduce it quickly. However, seeing that you are facing the issue, would like to help. So zipped my solution Win 64-VS 2019, and attached it below.

Do these answers help?

RediConsoleL1Quotes_20201029.zip


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.

Upvotes
21 1 3 4

Hi @zoya.farberov,

Thanks for your help so far.. Some more thoughts/questions:

1. The interface that is exposed (CacheControl) is clearly table based. The CacheEvent event exposed keys off the row #, and for Orders and Positions, it definitely one CacheControl object per table. Just because your example works, honestly doesn't mean it's a GOOD example. I can quite easily make an excel workbook with 100 tabs each having one row, and write extremely horrible code to search across all of them to find the relevant data. That would be a bad design though, don't you agree?

2. Since Submit is called only once, that makes CacheControl is a singleton? Or at least internal to Redi, L1 is a single table? (You're helping to make my point from #1) And am I to understand from what you're saying, that AddWatch must be called before Submit? What if I want to add a new subscription later? Do I AddWatch, and then Submit, or does the single Submit up front cover that case too? For Positions, I'm calling Submit once first (only a single CacheControl) and then AddWatch multiple times subsequently, one per account. This works and is very clean. Why is positions different than L1?

3. "usually not in L1". Can you elaborate please?

4. My user got false & error 5 calling this code: (Cache is the CacheControl object)

error = null;
object result = Cache.Submit("L1", string.Empty, ref error);
log.Error($"CacheInitialize, Result: {result}, error: {error}");

How should I go about debugging that? The query string being string.Empty should be valid for L1 per the example and everything else you've said.. ?

If you need a formal documentation request to update something as simple as the error codes on a method, that's an unfortunate environment to have to work in.. Maybe someone should let your managers know that having an onerous process where support staff can't make simple updates to documentation is unhealthy.

5. It's not hard to get L1 to compile, but my point is there is no project file here: https://github.com/Refinitiv-API-Samples/Example.REDI.CSharp.Examples/tree/master/REDIConsoleL1 which comes across to me as messy/unprofessional, and I'm kindly trying (for the third time now) to encourage you to fix that overlooked missing file. While you're at it, it would be better if there was a solution file in the root folder including all of the projects.

Your answers are encouraging, but do leave me wondering if you're understanding well what's going on within the CacheControl object or if you're just encouraging me to use a sample bit of code which happens to work but wasn't designed well in the first place. I haven't seen any information giving a reason why L1 requires a CacheControl per row, while the other collections (positions, orders, ...) all behave more logically. You've made reference to duplicated or missing events in other posts, but never with enough information to identify definitively why L1 is so special in this extremely common financial use case.

Presumably L1 maps back to the L1 table in BusCatalog.xml, right? Like Positions is POSMGR, and Locate is LOCPOS possibly.. There's all just tables, and the CacheEvent fires when a row changes.

I look forward to your response.

-Peter

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 @peter.drier,

I am escalating your questions to REDI product development.

Thanks for your patience.

Upvotes
32.2k 40 11 20

Hello @peter.drier,

We would like to address your last question on two levels:

In terms of AddWatch, DeleteWatch, and the consequent Submit call. The approach is to make all modifications to your L1 subscriptions first, and then to call Submit. Submit is what puts the AddWatch and DeleteWatch calls in effect.

In terms of the enhancement requests to REDI API, to REDI API examples, and to how REDI API examples are made available, we encourage you to submit your feedback directly, via your Refinitiv Account manager so that they can be best reviewed and prioritized by the relevant experts on REDI team.


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.

Upvotes
21 1 3 4

Hi @zoya.farberov,

First off, I was specifically told to come here for support. So I'm finding it unpleasant to be sent in a circle for such simple requests.

Second, you've missed quite a few things on my request, specifically numbers 3 and 4. My user is getting error code 5 when calling cache.submit on his machine. How do I debug that?

I get that you're a small team buried in a huge organization, but the things I'm asking for are far from unreasonable. I was hopeful when you referenced product development earlier that this would improve. I'm happy to take this to e-mail if you'd rather not do this in public?

-Peter



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.

Upvotes
21 1 3 4

And for the record, what you've just said about AddWatch, DeleteWatch and Submit is the opposite of what's shown in the examples in the documentation. Literally.

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.

Upvotes
32.2k 40 11 20

Hello @peter.drier,

Thank you for your feedback.

Allow me to try to help, by explaning the most efficient way to proceed.

Refinitiv API forums are dedicated to general discussions and questions centered around Refinitiv APIs. We are glad to help pointing you to the suitable educational materials, help you get started if you are having an issue getting started, building or running the examples that we make available.

My last answer to you, on your question, has been conveyed REDI development response.

As mentioned, we would like to help you, as a client, best, we do not want you running in circles, or to perceive the situation as such.

Therefore, we encourage you to contact your Refinitiv account manager as a customer directly, and they will assist you offline, directly working with you, in submission of any feedback on REDI API, examples, and will convey it to the right teams within Refinitiv organization.

If you would prefer the email approach, you can also submit via My Refinitiv Product Feedback form, please specify product=REDI and reference this question via link.

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.

Upvotes
21 1 3 4

Hi @zoya.farberov,

So you won't help me with understanding why the API is giving me an error #5 here.. even though it's definitely a question regarding the API which is seemingly undocumented in an application over a decade in age.

I found the development response insufficient as my user is still having a problem and is not able to load L1 data via the API even though Positions and Orders works fine for him.

I'm sort of baffled at what benefit you think adding an account manager into this process will achieve from a technical perspective.

-Peter

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.

Upvotes
32.2k 40 11 20

Hi @peter.drier,

Sorry to hear this, and this is why we advise to ask each question separately, rather then grouping multiple related questions into one. Asking each question separately allows us to make sure that every question will get an answer, please try to do so next time.

There were several questions, and I may have missed the main point; so let me just confirm, are you are running example L1 monitoring as is, without changes, and are you getting error 5 back consistently?

I have just submitted a request to verify that your REDI user is permissioned for programmatic market data access via REDI (hopefully you have registered on developers portal with the same email that you have with REDI product registration, and we are able to verify the permissions by this email, otherwise, please let us know). If you have not modified the example code, this is likely the cause.

I will also update this thread when I hear back on this.

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.

Upvotes
32.2k 40 11 20

Hi @peter.drier,

I have received the response from REDI permissioining: "The user does not have any market data associated with the user id.". This means you will not be able to consume L1 market data via monitoring example.

If this is something that you require, please contact your Refinitiv account manager to discuss your requirements.

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.

Upvotes
21 1 3 4

Hi @zoya.farberov,

Like I mentioned before, I'm working with a user (who does have market data permissioned) who is getting the Error #5. Sorry for the delay in getting back to this thread, I managed to get the user to run L1.exe (walking a trader through running your command line app made neither of us happy BTW) where he also gets the Error #5.

He also gets Error 5 in numerous variations of my code for L1 data, but his Order and Position tables are working as expected. I can send you his username separately if that will help.

Obviously, this would be more straightforward if I were directly permissioned for L1 data, but that isn't something presently available to my situation. So I'm left to code against a specification which, as I've noted, could be improved greatly. As is though, my code works for Orders, and Positions, and doesn't give me errors for L1 (no data without an error is what I expected). One could very easily make an argument that the API not telling me I'm not permissioned for the data is also a problem, but considering you don't like having multiple topics in a single thread, I'll leave that deficiency for any other readers of this thread to dream about..

My not being permissioned aside, the user in question is getting an error running the code which I don't get and which isn't documented. So, I'm back to my need for information to debug/fix Error 5..

-Peter


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.

Upvotes
32.2k 40 11 20

Hello @peter.drier,

Glad to hear that L1 integration is working for user as expected, for the most part (except for error 5).

Do they observe error when running provided L1 monitoring example code as is, without modifications, or only with your custom L1 monitoring code? To be clear, I did not reproduce it on my side, running the standard example.

Just in case, let me ask, does your modification just include more instruments? If this is the case, please zip and attach, I will try running on my side and let you know what I see. If it's more substantial code changes, investigating this in the framework of the discussion forum becomes impossible, would suggest to try to narrow down the issue by gradually scaling back to the working example code, and if not successful, ask user to work with Refinitiv account manager so they may come up with options to investigate this deeper.

If you would like me to request REDI documentation enhancements, adding a table of error codes on submit to REDI spec, on user's behalf, then yes, please share their userid. I think personally it would be helpful to have. Better yet, if the user can provide direct detailed feedback, via their Refinitiv account manager.

---

Now that I better understand the overall situation, let me mention something that may be helpful as well: did you/user have a chance to see REDI Excel examples Quote Monitor API and Quote Monitor DDE? These examples are more suitable to include both developer and non-developer users, so perhaps your user will find these more appealing and suitable to their needs.

Command line C# examples were designed for developers, as simple programmatic interface example, and a developer has an option to add custom visual representation if per their requirement.

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.

Upvotes
21 1 3 4

Hi @zoya.farberov,

Yes, they're running your L1.exe example code wrapped in the project file your github code is missing. I did change the symbols, as I didn't want to complicate things with options and futures at this point (and they're irrelevant to the project at hand). And I wanted stocks which traded 24h so we'd get price changes off hours.. The list is:

List<string> myInstrumentList = new List<string>(new string[] { "GOOG", "MSFT", "BA", "ZVZZT", "SPY", "GLD", "QQQ" });

Which should be perfectly fine with any US based user. Nothing else in the code has changed.

I just messaged Ormond (the Refinitiv Account Manager!!) with the details of what's going on here and Andy's userid. Perhaps it's better for the client if I don't post their userid here, and instead for you to get it from Ormond.

As for your "Quote Monitor API" xlsb file. I have just tried it myself, and looking at the code I see two things interesting.

1. The order of the Submit and AddWatch calls contradicts your previous instructions regarding how they must be used in order for successful operations.

2. There is absolutely no code present in the xlsb file to handle the error 5 condition if it were to happen. Errors aren't displayed to the user, nor logged.

Given those two things, it feels somewhere between unprofessional and sloppy to involve a business user in the testing of this XLSB at this time. And the DDE file is fundamentally irrelevant, unless you can elaborate as to why an unrelated API has any effect here.

Beyond that, the file is labeled Thompson Reuters, so you might want to add that to the list of things that need fixing while you're at it. Lest the branding folks come knocking.

At this point, if I were in your shoes, I'd be loading up the CacheControl code myself and checking to see what could possibly cause an error to return 5. Given Positions and Orders works and L1 gives an error, the problem is somehow focused to L1 for this particular user.

Ormond said he's reaching out.

-Peter

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.

Upvotes
32.2k 40 11 20

Hi @peter.drier,

Thanks for your feedback.

I am looking into the C# example suspected issue report, replaced your list in code and testing, So far- no errors. You can help by providing more specifics:

  • How long do you run on average, to see any errors?
  • Do they appear on some of the runs, so I should restart the example a couple of times, or all runs?
  • Do they appear at specific times of day?
  • Is there specific GUI activity that you think triggers the issue?
  • Anything in particular you do to reproduce the errors?

To be fully on the same page, let me confirm: it's via this print that you observe the errors?

    Console.WriteLine("On Submit err=" + err);

Thank you for contacting Ormond. This allows us to ensure, that all the relevant REDI API and documentation feedback gets fully captured and conveyed to the relevant REDI team members.

(totally agree with you about not posting any personal info on the public forums, thanks)

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.

Upvotes
21 1 3 4

Hi @zoya.farberov,

  1. It's immediate
  2. all runs for this user
  3. all times of the day
  4. no
  5. run your L1 app

yes, it's the submit call giving Andy the Error 5 via the console.writeline you reference.

Now maybe you can do something for me. Look at the code for CacheControl.Submit and see what can cause Error #5 to be returned. Given you have the code within your organization which creates the error in question, it makes the most sense to start there, right?

-Peter

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.

Upvotes
32.2k 40 11 20

Hi @peter.drier,

Thanks for the information provided.

I was not able to reproduce anything like what you describe, and neither have I heard of this issue before. Which makes it, very likely, user environment specific issue.

Having progressed to this point within the framework of the discussion forum, believe we will need to progress further offline. Will work with REDI team on the best next steps to investigate and keep you informed.

Thanks for your patience,

-AHS

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.

Upvotes
21 1 3 4

Hi @zoya.farberov,

So should I be hearing from you or someone else then? it's been ~5 days now..

-Peter

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.

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.