New posts are disabled while we improve the user experience.

You can browse the site, or for urgent issues, raise a query at MyAccount.

question

Upvotes
Accepted
2 0 0 3

Ric Not Found vs Permission Denied in API

In native clients there are different messages for:

- wrong RIC name input

- lack of access to RIC data

- source Stale

....

How can I distinguish those using RFAJ subscription?

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.

Upvote
Accepted
1.9k 7 11 16

Hello @pawel.c,

I assumed that you are using OMM interface of RFA Java application connecting to the infrastructure (i.e. TREP: ADH, ADS)

Here there are sample messages under different situations:

1. wrong RIC name input

This can be interpreted as non-existing RIC name. When this problem occurs, "The record could not be found" will appear.

ItemManager.processEvent: Received Item Event...
2018-03-05 19:11:27.313+0700
MESSAGE
	Msg Type: MsgType.STATUS_RESP
	Msg Model Type: MARKET_PRICE
	Indication Flags: 
	Hint Flags: HAS_ATTRIB_INFO | HAS_STATE
	State: CLOSED, SUSPECT, NOT_FOUND,  "The record could not be found"
	AttribInfo
		ServiceName: API_ELEKTRON_EPD_RSSL
		ServiceId: 2115
		Name: ICE.BKK
		NameType: 1 (RIC)
	Payload: None

2. lack of access to RIC data. The related scenarios can be as follows:

(a) unauthorized access

ItemManager.processEvent: Received Item Event...
2018-03-05 19:20:01.061+0700
MESSAGE
	Msg Type: MsgType.STATUS_RESP
	Msg Model Type: MARKET_PRICE
	Indication Flags: 
	Hint Flags: HAS_ATTRIB_INFO | HAS_STATE
	State: CLOSED, SUSPECT, NOT_ENTITLED,  "Access Denied: User req to IDN for Exch - HKG"
	AttribInfo
		ServiceName: RED3_ELEKTRON_EDGE_TOKYO
		ServiceId: 1221
		Name: 0001.HK
		NameType: 1 (RIC)
	Payload: None

Remark: We tried to test a Euro user subscribes to Hong Kong instrument.

(b) Server capacity limited

ItemManager.processEvent: Received Item Event...
2018-03-05 19:31:05.607+0700
MESSAGE
	Msg Type: MsgType.STATUS_RESP
	Msg Model Type: MARKET_PRICE
	Indication Flags: 
	Hint Flags: HAS_ATTRIB_INFO | HAS_STATE
	State: CLOSED, SUSPECT, TOO_MANY_ITEMS,  "A20: Item limit per service exceeded."
	AttribInfo
		ServiceName: API_ELEKTRON_EPD_RSSL
		ServiceId: 4012
		Name: THB=
		NameType: 1 (RIC)
	Payload: None

3. source Stale

Stale is represented as 'SUSPECT' in OMM.

ItemManager.processEvent: Received Item Event...
2018-03-05 19:35:06.777+0700
MESSAGE
	Msg Type: MsgType.STATUS_RESP
	Msg Model Type: MARKET_PRICE
	Indication Flags: 
	Hint Flags: HAS_ATTRIB_INFO | HAS_STATE
	State: OPEN, SUSPECT, NONE,  "A23: Service has gone down. Will recall when service becomes available."
	AttribInfo
		ServiceName: API_ADH_NI_PUB
		ServiceId: 8500
		Name: TRI.N
		NameType: 1 (RIC)
	Payload: None

These are examples error messages that can be found under the situations given. An attribute of the messages that conveys details is 'State'. Referring to the examples given above, State contains four sub-attributes as follows:

  • Stream State - returns the Stream value such as OPEN, NONSTREAMING, REDIRECT, CLOSED, CLOSED_RECOVER.
  • Data State - returns the Stream value such as OPEN, NO_CHANGE, SUSPECT.
  • Code - returns the Stream value such as ALREADY_OPEN, ERROR, DACS_DOWN, NOT_FOUND, TOO_MANY_ITEMS, etc..
  • Text - returns information as String.

Code and Text sometimes correspond to each other. For example,

  • Code: 'NOT_FOUND' and Text: 'The record could not be found'
  • Code: 'NOT_ENTITLED' and Text: Access Denied: 'User req to IDN for Exch - <XXX>'
  • Code: 'TOO_MANY_ITEMS' and Text: 'A20: Item limit per service exceeded.'

You can find more details of RFA Java's Stream States, Data States, and Codes from RFAJ_DeveloperGuide.pdf which was normally included in <RFA Java Package>/Docs folder.

Furthermore, if you are connecting to TREP infrastructure, you can find information regarding error messages from the installation guide which was also delivered with the package as well

Anyway, please be aware of that these messages as some of them don't appear in the exact phrases/sentences because they depend on a scenario and the connecting server that may customize them too. For instance, if you don't have the authorization to access an instrument from STOCK EXCHANGE OF THAILAND, the text will be 'Access Denied: User req to IDN for Exch - SET' instead of 'Access Denied: User req to IDN for Exch - HKG'.

Hope this helps!


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
25.4k 90 13 26

Hi @pawel.c

Just to add a small note to Nipat excellent and comprehensive answer.

As Nipat mentioned,the text message can vary somewhat. The key thing here is that you should not rely on parsing the text to control programmatic behaviour. The text should only be used for displaying message / diagnostic logging type stuff. You should use the numeric OMMState.Code attribute instead.

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.