Multiple services using Olympia

delphi

(estebanp) #1

Hi guys,

Delphi Tokyo. Latest Release - 1

We have dozens of services, including multiple instances of the same service to offer redundancy. We send messages (Event Sinks) across all the services sharing the same app Id and Olympia.

Lets say we have two services in charge of buying an Item, lets call it ShoppingService.

Every time an item is bought, the instance of the service that received the request will send out an Event Sink to all other services and clients listening to that event.

Services and clients will register to a ShoppingService whenever they want to listen to this kind of events, but due to the load balancing process this registration could happen on different instances of the ShoppingService.

Is it safe to assume that services that did not register with that instance of the Shopping Service will receive the Event Sink message even if they did not originally register (via RegisterClient on the server side) to the instance that is sending out the message?

Also, when new clients/services register to an instance, do the other instances of the Olympia Event Repository are notified of it? just like with sessions so they are in synch?

Also if two services have an Olympia component on it and a session expires, will both get an OnBeforeDeleteSession, OnSessionDeleted etc?

We currently have logic to only process actions from a “controller” Olympia node and not every node to avoid race conditions assuming that this is the case.

Thank you


(EvgenyK) #2

Hi,

in general your solution will works, but you can lose data if you store anything into session.

imagine case:

  • method1 of service1 stores something into session. Say, ‘name=value’ pair. this data will be uploaded into Olympia when session is released at closing execution of this method
  • method2 of service2 also opens the same session. session doesn’t contain ‘name=value’ pair at this moment.
  • method1 is finished and session is released. now ‘name=value’ pair from 1st step is uploaded into Olympia.
  • method 2 is finished and uploads his version of Session to server. now session on server doesn’t contain ‘name=value’ pair.

they should receive these events, but they will be able to process them only if these events are registered in EventReceiver.

yes, they both will receive these events.