2.9. Using Custom Message Interceptors

Custom message interceptors may be used to apply special processing logic to incoming and outgoing AMF messages in their de-serialized Java form. For example, an interceptor can be used to inspect the contents of the incoming message, or to add extra information to the outgoing message.

Custom message processing logic is provided through implementations of the org.springframework.flex.core.MessageInterceptor interface. These implementations must be configured as Spring beans and then registered through the XML configuration namespace as follows:

<!-- Custom message interceptor configured as a Spring bean -->
<bean id="myMessageInterceptor" class="com.foo.app.MyMessageInterceptor"/>

<flex:message-broker>
	<flex:message-interceptor ref="myMessageInterceptor"/>
</flex:message-broker>