每个 StreamingAmf 连接有多个消费者?

发布于 2024-11-06 12:41:44 字数 2159 浏览 1 评论 0原文

我有一个 Adob​​e 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文