Basically, the completion event itself does not provide the reason of how the data stream is closed. The reason/information can be found in the status message that comes before the completion event so the application should look for the detail of the stream closure in the status message rather than in the completion event. Here are the examples of status messages when the stream is closed.
Invaid RIC Item: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: hEED ServiceId: 2114 Name: TEST.BK NameType: 1 (RIC) Payload: NoneNo Permission: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 Specialist - SDPREREINTO" AttribInfo ServiceName: hEED ServiceId: 2114 Name: BRL10MNDF= NameType: 1 (RIC) Payload: None
If one ignores the explicit completion events in RFA/RSSL you can simply use msg.isFinal() under processEvent() to gain stateful awareness of the event. For RFA/SSL you can use event.isEventStreamClosed() instead.
Thanks Steve. We're trying to figure out how to determine if the completion event was a result of an entitlementsissue versus some other issue. Are the other categories of reasons which can result in acompletion event?
Is your question closer to: What are the reason a subscription can be closed?
[Edited] The completion event will be sent as final event from an event stream. It indicates that the event's stream has been closed, when the application call unregisterClient() to close the event stream. It should be an issue stated by Jirapongse below.
There are two ways in which an event stream can beclosed:
An application should call isEventStreamClosed() functionon incoming messages to determine whether an event stream is closed. Note thatif an application registers for completion events and closes the event streamvia an unregisterClient() call to RFA, the application must be preparedto receive either a completion event or some other event that closes thestream. If the application receives an event closing the stream other than acompletion event, the application will not receive the completion event.
Normally, the application uses the completion events when itrelinquishes the requests from different threads than the dispatching thread. Afterunregistering the handle, the application must wait for the completion event orverify isEventStreamClosed() before deleting an instance of an EventHandler.
I would like to suggest upgrading the application to use thelatest version of RFA C++ (7.6 or 8.0) because there are a lot of issues fixedregarding the completion event.