Class TrackMessageSizeFilter

  • All Implemented Interfaces:
    BroadcastFilter, PerRequestBroadcastFilter

    public class TrackMessageSizeFilter
    extends java.lang.Object
    implements PerRequestBroadcastFilter
    A PerRequestBroadcastFilter implementation that add the expected length of the message. This is useful when used with the atmosphere.js library as the library will read the expected size and wait for the entire messages to be received before invoking its associated callback.

    NOTE: The broadcasted message MUST BE a String. If your application is broadcasting another object, you need to write your own Filter.

    If you aren't using atmosphere.js, you need to add the HeaderConfig.X_ATMOSPHERE_TRACKMESSAGESIZE header in order to enable that Filter. The delimiter character used is '|'.

    For example, broadcasting String 'helloword' will be received by the client as '9|helloword' but delivered as 'helloword' to the Javascript function/callback.