我正在开发一个使用 Atmosphere Framework jQuery-jersey-pubsub 的项目。我希望跟踪我的消息的大小,Atmosphere 已经具有该功能,即 TrackMessageSizeFilter 。我已将此文件包含在服务器上,还在客户端上设置了 trackMessageLength: true
。我还添加了条目
<init-param>
<param-name>org.atmosphere.cpr.broadcastFilterClasses</param-name>
<param-value>org.atmosphere.client.TrackMessageSizeFilter</param-value>
</init-param>
我也尝试过
<init-param>
<param-name>org.atmosphere.cpr.broadcastFilterClasses</param-name>
<param-value>com.mypackage.TrackMessageSizeFilter</param-value>
</init-param>
似乎都没有将消息大小附加到我的消息中。我该如何实现这一目标?
最佳答案
使用 TrackMessageSizeInterceptor,只需通过 init-param 安装它即可。
--让弗朗索瓦
关于java - 如何在Atmosphere中实现TrackMessageSizeFilter?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20675426/