The DSB is shipped with several components which allows service invocation monitoring which are detailled below.
Short view
A collection of modules routers are in charge of intercepting messages on request, response and ACK (more details on what is a router module are given here). At these different steps, the modules add some monitoring information such as timestamp and other KPIs. One module is then dedicated of collecting these data and sending reports to a monitoring layer at different message exchange phases.
Implementations
The DSB has its own monitoring collectors and APIs and is totally independent from any monitoring tools. This API can be found in module dsb-monitoring-api. Different implementations are provided by default and are listed below.
EasierBSM implementation
A default implementation shipped with the default distribution is based on top of EASIERBSM. At the implementation level, it means that every time an endpoint is activated in the DSB, an endpoint registry listener sends a registration query to easierBSM. Then, each time a message is exchanged between a service consumer and provider, the DSB monitoring modules will send reports to easierBSM layer, translating DSB monitoring data to easierBSM one.
Configuration
The monitoring configuration file is available at DSB_HOME/conf/monitoring.cfg (a standard property file with key/value pairs). Parameters are:
- monitoring.active=BOOLEAN where BOOLEAN is true or false: Activate or not monitoring by static configuration. Note: Changing this parameter value at runtime has no effect.
- monitoring.base=TBD
- monitoring.admin=URL where URL is the URL of the monitoring management endpoint ie the one which will receive the new registration query as described above.
- monitoring.listener=
Web service notification implementation
Another monitoring implementation is based on Web service notification (WSN). Each time a message is exchanged between a service consumer and provider, a report is generated and sent to the internal WSN engine. If there are some subscribers which are interested in the monitoring data, they will be notified by the WSN engine with the monitoring data inside a WSN notify message such as:
Configuration
- The WSN implementation provides an API to activate/deactivate monitoring (org.petalslink.dsb.ws.api.PubSubMonitoringManager) and get some additional information about the WSN monitoring stuff. This API is automatically exposed by the DSB as a Web service at startup and is available at http://HOST:PORT/petals/ws/PubSubMonitoringManager.
- To receive notifications containing the monitoring data, interested parties must subscribe to the monitoring topic which is defined as a complete QName:
- name : MonitoringTopic
- NS : http://www.petalslink.org/dsb/topicsns/
- prefix : dsb
An example of subscription payload can be
In the previous snippet, each time a monitoring message is published to the MonitoringTopic, the subscriber will receive a notification at http://localhost:9001/MonitoringSubscriber.
More information on how to use WSN stuff and clients are explained in the WSN Page.
Code
All the code of this implementation is located in the dsb-kernel-pubsubmonitoringservice module.