Skip to main content

Configuring the Service Activity Monitoring Agent in a Servlet container

The main configuration files for Agents are agent.properties and the filter and handler configuration files. The agent.properties can be created by the user and placed in the classpath. Filters and handlers are based on Spring bean configuration and can be added to the application's context (for example, beans.xml).

Properties description:

Property

Default

Description

collector.scheduler.interval   Interval (in milliseconds) of Agent built-in scheduler. The Agent will make one or several calls to the Service Activity Monitoring Server sending Events from local queue at this specified value. The number of calls actually made to the Service Activity Monitoring Server when scheduler interval has arrived is decided by the number of events in the local queue and the number of collector.maxEventsPerCall. This interval must be greater than 0.
collector.maxEventsPerCall   The value of this parameter is used to restrict the max number of Events per call to the Service Activity Monitoring Server. Lower values help to avoid sending overly large SOAP body messages to the Service Activity Monitoring server.
collector.lifecycleEvent false Whether the Agent should collect and send the lifecycle events to the Service Activity Monitoring Server. If true, the Service Activity Monitoring Server must be started before the Talend Runtime Container, otherwise connection exceptions will be thrown.
log.messageContent true Whether the Agent should store the Producer and Consumer SOAP message content into Events and send them to the Service Activity Monitoring Server.
log.maxContentLength -1 Sets the maximum SOAP content length per Event. -1 is unlimited.
log.enforceMessageIDTransfer false If true, Service Activity Monitoring will add WS-Addressing functionality implicitly and enforce MessageID transfer between Events. If false, the MessageID will be null in the Events if the user doesn't enable the WSAddressingFeature or Policy with Addressing explicitly.
log.messageContent.override true

Whether the controlling of the logging behavior at service level is allowed.

If this property is set to true, the logging behavior will be controlled by the org.talend.esb.sam.agent.log.messageContent property at service level. If false, the logging behavior will be controlled by the log.messageContent property at runtime.

service.url   The URL of Service Activity Monitoring Server that the Agent is to communicate with.
service.retry.number 5 Number of retries when a call to the Service Activity Monitoring Server fails.
service.retry.delay 1000 Delay in milliseconds before the next retry to call the Service Activity Monitoring Server

For example:

collector.scheduler.interval=500
collector.maxEventsPerCall=10
collector.lifecycleEvent=false

log.messageContent=true
log.maxContentLength=-1
log.enforceMessageIDTransfer=true

service.url=http://localhost:8080/sam-server-war/services/MonitoringServiceSOAP
service.retry.number=3
service.retry.delay=5000

To filter or manipulate events, these Filter/Handler spring beans should be added into your Service provider or Service consumer bundle or jar, then these beans will be autowired by Service Activity Monitoring agent.

Some example bean definitions can be found below:

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

    <bean id="stringContentFilter"
        class="org.talend.esb.sam.common.filter.impl.StringContentFilter">
        <property name="wordsToFilter">
            <list>
                <value>abc</value>
            </list>
        </property>
    </bean>

    <bean class="org.talend.esb.sam.common.filter.impl.JxPathFilter">
        <constructor-arg value="content='test' and eventType='FAULT_IN' and customInfo/key1='value1'"/>
    </bean>

    <bean id="passwordHandler"
        class="org.talend.esb.sam.common.handler.impl.PasswordHandler">
        <property name="tagnames">
            <list>
                <value>Password</value>
            </list>
        </property>
    </bean>

    <bean id="fixedPropertiesHandler"
        class="org.talend.esb.sam.common.handler.impl.CustomInfoHandler">
        <property name="customInfo">
            <map>
                <entry key="Application name" value="Placeholder App" />
                <entry key="Stage" value="Dev" />
            </map>
        </property>
    </bean>
</beans>

For more information about how to use Filter/Handler in WAR applications or OSGi bundles, go to the following folder of the Talend ESB: examples/talend/tesb/sam.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!