How to get the list of subscribers of an EventSink?

Hi guys,

Delphi Tokyo, latest RO/DA.

I’m trying to retrieve the list of Sessions (or session Guids) registered to receive call backs of an specific event.

Currently the Sink_Writer supports a exclusion/inclusion list, which makes sense, but obviously we want to do those inclusions/exclusions from the sessions/clients that are registered to receive the specific sink.

My objective is to apply some filters within the registered sessions for that sink to determine the exclusions/inclusions at runtime depending on values stored on their sessions.

Thank you.

you can check for supporting of specific event like ROInMemoryEventRepository.SessionReferences[x].HandlesEventSink(aEventSinkId).

easier way can be in adding list of supported events into session and checking it later

Hi Evgeny,

Thank you for answering. It seems that the SessionReferences is not availabile on the Olympia repository, can it be exposed for a sense of completeness?

Also, let me explain a bit more the final goal which is to implement routing techniques like ROUT.NORTH.* or ROUT.* (as some AMQP systems do) so basically the client will registered the traditional way like RegisterEvent(xxxx) and then call a method with its routing which will be then stored in its session.

Later on, and this is the important part, if the event happens within the clients that registered to it, it will check the routing and decide if the data about to be send out matches with the pattern of the routing deciding to send or not the data to the client (adding or removing items to the list inclusion/exclusion list).

I could add on the session all the events it supports but i’ll guess that’s redundant cause for all purposes the SDK already has this information available, I just need to be able to access it and make decisions based on it.

Now another question, what happens if i add a session to the inclusion list on the sink writer that HAS NOT registered to receive an event sink? or the opposite?

TROOlympiaEventRepository is descendant of TROInMemoryEventRepository:

  TROOlympiaEventRepository = class(TROInMemoryEventRepository, IROValidatedSessionsChangesListener, IOlympiaEvents)

check TROOlympiaEventRepository.DoStoreEventData - if session can’t handle specific event sink, this session will be removed from target list

1 Like

Hi Evgeny,

Once again, thank you for the response. I was indeed mistaken, I wasnt typecasting the EventRepository attached to the service to the proper class. Now i can access the SessionReferences.

One thing that I’m noticing and I’m trying to see what can be going wrong is that after I do some sort of “Logout” process where I explicitly call DESTROYSESSION, I will expect that same session to be removed from the SessionReferences if the session is included on the EventRepository but it doesnt seem to be doing so.

I did a test by going through all the SessionRerences and looking for them on the repository via IsSessionPresent/FindSession and indeed they are gone from the SessionManager, but are still showing up on the SessionReferences.

I tried adding a specific call to EventRepository.RemoveSession(GUID) right before the DestroySession, but didnt make a difference. Any ideas?

Have you unsubscribed client with TRORemoteDataModule.UnregisterEventClient method? I suppose you are using .NET compatible mode of events.

Hi Evgeny,

Yes, I do call UnregisterEventClient on the server side. Tried doing it before and after the Destroysession just in case but in both situations the SessionReference keeps the ClientID (SessionID).

odd, UnregisterEventClient calls fEventRepository.RemoveSession and it does fSessionIDs.Delete(idx);
can you check, that EventRepository is assigned in your login service

I just sent an email to support with a modified Session Types sample demoing the issue.