Skip to content

Talend service activity monitoring

Marc Dutoo edited this page Apr 28, 2014 · 3 revisions

Study of Talend SAM architecture

what : http://www.liquid-reality.de/display/liquid/2011/05/25/Monitoring+your+CXF+Services+Calls+with+Talend+ESB+Standard+Edition

service : MonitoringService.putEvents() https://github.com/Talend/tesb-rt-se/blob/master/sam/sam-common/src/main/java/org/talend/esb/sam/common/service

agent :

server : persists monitoring events using spring jdbctemplate, simple servlet based ui https://github.com/Talend/tesb-rt-se/tree/master/sam/sam-server/src/main/java/org/talend/esb/sam/server

on both sides : handlers (password removal, custom info), filters (jxpath)

Installation Talend Service Activity Monitoring server (working with mysql) in Easysoa :

  • Copy mysql-connector-java-5.1.22-bin.jar in serviceRegistry/lib
  • Copy sam-server-war.war in serviceRegistry/webapps
  • Copy create_mysql.sql file in serviceRegistry/webapps/sam-server-war/WEB-INF or create manually the base (base name => samDB, prefered solution) in mysql with this script. Warning : the storage engine for the database tables must be 'MyIsam'. If it is not the case, the SAM server will send back a success response but the events will not be persisted in the database. The MySQL server is not included in EasySOA.
  • Open the tomcat context.xml file in serviceRegistry/conf/ and add this resource tag :
<Resource name="jdbc/datasource" auth="Container"
    type="javax.sql.DataSource" username="root" password=""
    driverClassName="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/samDB"
    maxActive="8" maxIdle="30" maxWait="10000"/>
  • Modify the file serviceRegistry/webapps/sam-server-war/WEB-INF/logserver.properties : comment the derby block and uncomment the mysql block
    ...
    #for Derby (by default)
    #db.datasource=java:comp/env/jdbc/datasource
    #db.dialect=derbyDialect
    #db.recreate=true
    #db.createsql=create.sql

    #for Mysql
    db.datasource=java:comp/env/jdbc/datasource
    db.dialect=mysqlDialect
    db.recreate=false
    db.createsql=create_mysql.sql
    ...

To check if the SAM server is started, go to : http://localhost:8080/sam-server-war/. The following screen must be displayed :

zzzzz

Using SAM from FraSCAti

Using SAM from FraSCAti - v1 : call SAM Server from a dedicated CXF Intent

Architecture of the solution :

The CXF Monitiring intent is based on FraSCAti CXF Intents. This intent work with a FraSCAti binding ws reference to the SOAP web service exposed by the SAM server. Here is the intent composite.

The CXFMonitoringIntent class extends the AbstractHandlerIntent class and implements the Handler interface. With the handleMessage(MessageContext context) method, we have access to the CXF Message context and to the CXF Message. The CXF message is then transformed by a MessageToEventMapper object into a SAM Event and send to the server.

The CXF monitoring intent can be used only on a FraSCAti binding.ws tag. Here the sample composite

The sources of the CXF Monitoring intent are available here : https://github.com/easysoa/EasySOA/tree/master/easysoa-proxy/easysoa-proxy-intents/easysoa-proxy-intents-cxfMonitoringIntent

limits : no message id or flow id, so can't correlate among req / resps & client / server

Using SAM from FraSCAti - LATER v2 alternatives : call SAM Server from a dedicated CXF Intent

Clone this wiki locally