Skip to content
lukaszPulawski edited this page May 26, 2015 · 7 revisions

Events in communication with services

Every communication between ratel client and server raises events that can be used to monitor application health. The events are risen when service is called and when it returns either normal or exceptional result. The following list contains all types of events currently supported by Ratel:

The events contain information about creation time and ProcessContext so you can combine these monitoring events with Traceability feature to build flexible monitoring tools.

Subscribing to communication events

If you want to subscribe to the events, you just need to register a bean that implements one of the following interfaces:

Examplary use:

@Component
public class MonitoringEvent implements ServiceCallListener {
  public void remoteServiceCalled(RemoteServiceCallEvent event){ 
   //this method will be called when a client sends a request to a remote service
    ...

Important note

Please note that clients and services have separate contexts, (most typically they reside in different machines) so you have to monitor events separately on client and on server side. In particular, a listener registered on client side won't be notified about ServiceInstance*Events and vice-versa.