question

Upvotes
Accepted
3 2 3 3

How do we know snapshot(RFA) request has been fulfilled?

Snapshot requests result in multiple responses, how do we know snapshot request has been fulfilled. So that we can close the connection with TREP.

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.

Monitored by @Warat B.

@Rathish K T

Thank you for your participation in the forum.

Are any of the replies below satisfactory in resolving your query?

If yes please click the 'Accept' text next to the most 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 @Rathish K T

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
4.4k 10 6 9

It is best to just follow the "Closing Event Streams" procedure.

The application should call isEventStreamClosed() function on incoming messages to determine whether an event stream is closed.

If the isEventStreamClosed() function call returns true, then the stream is closed and the application can clean up its resources.

void processEvent(const rfa::common::Event & event )
{
	switch( event.getType() )
	{
	case ConnectionEventEnum:
		processConnectionEvent( static_cast<const ConnectionEvent &>( event ) );
		break;
	case OMMItemEventEnum:
		processOMMItemEvent( static_cast<const OMMItemEvent &>( event ) );
		break;
	case OMMCmdErrorEventEnum:
		processOMMCmdErrorEvent( static_cast<const OMMCmdErrorEvent &>( event ) );
		break;
	case LoggerNotifyEventEnum:
		processLoggerNotifyEvent( static_cast<const LoggerNotifyEvent &>( event ) );
		break;
	default:
		break;
	}
	if ( event.isEventStreamClosed() )
		//Event stream is closed. Application can clean up related resources.
}
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.

But when we request snapshot for multiple RIC's ex USD=, EUR= and GBP=. this "event.isEventStreamClosed()" is getting fired for every rate response for RIC. We Like to know the last RIC's request is fulfilled. so that we could close the connection.

In that case, you have to either count the number of request, or create a watch list.

Just increase count or add item to watch list when you call registerClient(), and decrease count/remove item when isEventStreamClosed() function returns true.

When count is zero or watch list is empty, then you can close the connection.

Hi @Warat-B, Thanks for your answer, It works now.

Upvotes
582 9 15 23

Hi @Rathish K T

If the application sent a non-streaming (snapshot) request for a valid item, the final refresh response of the multi-part refresh messages should have the REFRESH COMPLETE flag in the indication mask. Also, it should receive a COMPLETION_EVENT (the event stream is closed) after that.

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.