JBoss.orgCommunity Documentation

Chapter 13. JBossWS-Recordsmanagement

13.1. What is recorded
13.2. Use cases
13.3. How it works and how to use it
13.3.1. Server side
13.3.2. Client side
13.4. Advanced hints
13.4.1. Adding custom recorders
13.4.2. Handler's position
13.4.3. Multiple handlers
13.5. Future extensions
13.5.1. Database recorder
13.5.2. Custom log writer
13.6. References

JBossWS records' collection and management system gives administrators a means of performing custom analysis of their webservice traffic as well as exporting communication logs.

 

Each record is basically composed of a message plus additional information; here are the current record attributes:

Of course records may also have meaningful values for a subset of the afore mentioned record attributes.

 

What are records useful for? In spite of endpoint metrics that provide response time information and counts of invocations, records provide users with rich data about the content of the exchanged messages and their sender/receiver. The record system allows fine grained management and is customizable according to the users need; some of the use cases supported by the default configuration are:

  • Logging request and response messages: being able to record messages received from and sent to a given service consumer without stopping the provider may be really useful. You just need to set the recording attribute of their endpoint's LogRecorder to true. The added value of this logging solution comes from the use of filters through which messages coming from a given address and related to a given wsdl operation only can be logged.

  • Accountability: service providers may want to know which consumers are actually hitting a given service. This can be done for example using the getClientHosts functionality of the MemoryBufferRecorder once it has been switched to recording state.

  • Getting statistics, filtering records: service administrators might want to see the last records related to a given endpoint or operation, the last records related to messages coming from a given customer and the response the system gave them, etc. These information can be obtained using the getRecordsByOperation, getRecordsByClientHost or the more general getMatchingRecords functionality of the MemoryBufferRecorder.

 

The recording system is composed of

 

On server side records are collected by JAX-WS handlers and passed to the configured processors. JBossWS comes with two default record processors that are plugged into every endpoint during the deployment:

Every processors can be fine tuned to process some record attributes only according to the user and/or performance requirements. Default processors are not in recording mode upon creation, thus you need to switch them to recording mode through their MBean interfaces (see the Recording flag in the jmx-console).

Common processor properties and their respective defaults values are:

The recorders can be configured in the stacks bean configuration

  <!-- Installed Record Processors-->
  <bean name="WSMemoryBufferRecorder" class="org.jboss.wsf.framework.management.recording.MemoryBufferRecorder">
    <property name="recording">false</property>
  </bean>
  <bean name="WSLogRecorder" class="org.jboss.wsf.framework.management.recording.LogRecorder">
    <property name="recording">false</property>
  </bean>

The recording system is available for all the JBossWS supported stacks. However slightly different procedure is required to enable it depending on the used stack.

Native stack comes with JBossWS - JAX-WS Endpoint Configuration. The default standard endpoint already has the server side recording handler:

  <endpoint-config>
    <config-name>Standard Endpoint</config-name>
    <pre-handler-chains>
      <javaee:handler-chain>
        <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
        <javaee:handler>
          <javaee:handler-name>Recording Handler</javaee:handler-name>
          <javaee:handler-class>org.jboss.wsf.framework.invocation.RecordingServerHandler</javaee:handler-class>
        </javaee:handler>
      </javaee:handler-chain>
    </pre-handler-chains>
  </endpoint-config>

thus nothing is required to use it since it is automatically installed in the pre-handler-chain. Of course you might want to add it to other endpoint configurations you're using.

Metro and CXF stacks

Other stacks require users to manually add the org.jboss.wsf.framework.invocation.RecordingServerHandler to their endpoint handler chain. This can be done the same way common user handlers are added.

Once the handler is properly added to the chain, log recording configuration is agnostic to the used stack. Users just need to tune the processors parameters though their MBean interfaces.

 

This paragraph covers eventual future extensions and/or idea JBossWS users may want to leverage for their own business.

You might want to take a look at the org.jboss.wsf.framework.management.recording and org.jboss.wsf.spi.management.recording packages in the source code to better understand how all this works and can be used.