每个StreamingAmf连接多个消费者?

时间:2011-05-11 19:13:53

标签: flex4 air blazeds

我有一个Adobe Air 2.0应用程序也在使用Spring BlazeDS集成。在这个应用程序中,我有几个数据网格。设计是针对每个网格的模型注册消费者以监听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>

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>

消费者代码

    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();

0 个答案:

没有答案