每个 StreamingAmf 连接有多个消费者?
我有一个 Adobe Air 2.0 应用程序,它也利用 Spring BlazeDS 集成。在这个应用程序中,我有几个数据网格。该设计是为每个网格的模型注册一个 Consumer 来监听从 BlazeDS 推送的更改。第一个实例化的网格工作正常,但是每个后续网格都会在 BlazeDS 中导致以下警告,
[WARN] [Endpoint.StreamingAMF] Endpoint with id 'streaming-amf' received a duplicate streaming connection request from, FlexClient with id ''
我的印象是您可以在 Flex/Air 应用程序中拥有多个使用者。我是否弄错了或者我只是错过了配置中的某些内容?
服务器端通道定义
<channel-definition id="streaming-amf" class="mx.messaging.channels.StreamingAMFChannel">
<endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/streamingamf" class="flex.messaging.endpoints.StreamingAMFEndpoint"/>
<properties>
<add-no-cache-headers>false</add-no-cache-headers>
<max-streaming-clients>15</max-streaming-clients>
<user-agent-settings>
<user-agent match-on="AdobeAIR" kickstart-bytes="2048" max-streaming-connections-per-session="2" />
<user-agent match-on="MSIE" kickstart-bytes="2048" max-streaming-connections-per-session="3" />
<user-agent match-on="Firefox" kickstart-bytes="2048" max-streaming-connections-per-session="3" />
</user-agent-settings>
</properties>
</channel-definition>
通道集代码
<s:ChannelSet id="pricingCS">
<s:channels>
<s:StreamingAMFChannel id="streaming-amf"
url="http://localhost:8080/blazeds/messagebroker/streamingamf"
connectTimeout="5"/>
</s:channels>
</s:ChannelSet>
消费者代码
consumer = new Consumer();
consumer.id = "pricingConsumer";
consumer.destination = "pricingUpdates";
consumer.subtopic = pId;
consumer.channelSet = channelSet;
consumer.addEventListener(MessageEvent.MESSAGE, priceUpdate);
consumer.addEventListener(MessageFaultEvent.FAULT, priceUpdateFail);
consumer.subscribe();
I have an Adobe Air 2.0 application that is also utilizing Spring BlazeDS integration. Inside this application I have a couple of data grids. The design was for each grid's model to register a Consumer to listen for changes pushed from BlazeDS. The first grid instantiated works correctly, however each subsequent grid causes the following warning in BlazeDS
[WARN] [Endpoint.StreamingAMF] Endpoint with id 'streaming-amf' received a duplicate streaming connection request from, FlexClient with id ''
I was under the impression you could have multiple consumers inside a Flex/Air application. Am I mistaken or have I just missed something in my configuration?
Server side channel definition
<channel-definition id="streaming-amf" class="mx.messaging.channels.StreamingAMFChannel">
<endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/streamingamf" class="flex.messaging.endpoints.StreamingAMFEndpoint"/>
<properties>
<add-no-cache-headers>false</add-no-cache-headers>
<max-streaming-clients>15</max-streaming-clients>
<user-agent-settings>
<user-agent match-on="AdobeAIR" kickstart-bytes="2048" max-streaming-connections-per-session="2" />
<user-agent match-on="MSIE" kickstart-bytes="2048" max-streaming-connections-per-session="3" />
<user-agent match-on="Firefox" kickstart-bytes="2048" max-streaming-connections-per-session="3" />
</user-agent-settings>
</properties>
</channel-definition>
Code for Channelset
<s:ChannelSet id="pricingCS">
<s:channels>
<s:StreamingAMFChannel id="streaming-amf"
url="http://localhost:8080/blazeds/messagebroker/streamingamf"
connectTimeout="5"/>
</s:channels>
</s:ChannelSet>
Code for Consumer
consumer = new Consumer();
consumer.id = "pricingConsumer";
consumer.destination = "pricingUpdates";
consumer.subtopic = pId;
consumer.channelSet = channelSet;
consumer.addEventListener(MessageEvent.MESSAGE, priceUpdate);
consumer.addEventListener(MessageFaultEvent.FAULT, priceUpdateFail);
consumer.subscribe();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论