question

Upvotes
Accepted
16 2 2 3

How to get the certain data of bid/ask and time field in order to save to local variables?

after i have sended a batch of item-request(marketPrice) ,am i supposed to receive the responses by the function:processEvent() automatically? And i need to get the information including itemname, bid/ask, time field, i have seen the examples which just decode all the fields out, so how can i get all these data? By the means of compare the Strings such as "bid" with the fieldEntry name? In addition, how can i get the itemName , from the content of the event variables?

treprfarfa-api
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.

1 Answer

Upvotes
Accepted
23.7k 84 10 22

Hi @1069772808

It is more appropriate / efficient to use Field ID (from Field Entry) rather than Field Name/String matching.

With regards the RIC name from the response, you can find it in the AttribInfo of the RefreshMsg. AttribInfo is normally excluded from Update Messages to save bandwidth. Many developers usually store the handle returned from register client call in a local collection and then perform lookup to find out which request the response corresponds to.

OR they pass in a closure parameter when they call the register client method - and the closure value is then available from the response event (e.g. the closure could be a reference to your local object representing that record/RIC).

OR you can if you wish set the ATTRIB_INFO_IN_UPDATES flag when making your Request - so that the Attrib Info is included in Updates as well as Refresh.

e.g.

ommmsg.setIndicationFlags(OMMMsg.Indication.ATTRIB_INFO_IN_UPDATES);

If you have not done so already I recommend you work through the start tutorials for RFA Java available here on this website.

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.