开发者

Multiple consumers per StreamingAmf connection?

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(开发者_如何学JAVAMessageEvent.MESSAGE, priceUpdate);
    consumer.addEventListener(MessageFaultEvent.FAULT, priceUpdateFail);
    consumer.subscribe();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜