SamCooper / COMMON_SPEC_RIDS

1 stars 0 forks source link

Add a Ping service #77

Open SamCooper opened 6 years ago

SamCooper commented 6 years ago

As discussed during our review in Gaithersburg of the Common Agency review RIDs, we are thinking about adding a Ping service to the Common services.

As discussed, it would be a good service to have along side things like Directory service for detecting "alive-ness" of a service provider retrieved from the Directory service, and it satisfies issues raised many times about how the Directory service is not a live view of applications in the system.

Comments from Dan Smith: I think we need it, but we need to figure out a few things.

From Stefan Gaertner: Yes, I’d like to see this service added. I see value for it on the space link (we always use similar PUS service 17 at the beginning of a LEO satellite contact for example) as well as on ground.

Although one might think about more sophisticated “Health” services (heartbeat, health status reports, …), especially on ground, from an interoperability perspective a simple Ping service realized as a SUBMIT operation should be enough. For anything more advanced I guess every agency has its own health monitoring system in place. It is most probably neither needed nor wanted to expose this system for inter-agency use. For this use case one could use the Parameter or Aggregation service anyway.

CesarCoelho commented 5 years ago

Check what it was done for the NanoSat MO Framework, don't try to reinvent the wheel. For the NanoSat MO Framework, I defined a "Heartbeat service" and implemented it successfully. It has 2 operations: beat (PUB-SUB), and getPeriod (REQUEST). Instead of ping, I use the getPeriod operation to determine the "aliveness" of the provider. The operation always return the same value, the period of the beat.

You can check the XML here: https://github.com/esa/nanosat-mo-framework/blob/master/core/mo-services-xml/src/main/resources/xml/ServiceDefSM.xml#L239

And the actual implementation is here: https://github.com/esa/nanosat-mo-framework/blob/master/core/mo-services-impl/nmf-software-management-impl/src/main/java/esa/mo/sm/impl/provider/HeartbeatProviderServiceImpl.java

If you want to use it out-of-the-box, the maven dependency is:

int.esa.nmf.core.moservices.impl nmf-software-management