Multiple consumers per StreamingAmf connection?

可紊 提交于 2019-12-13 00:06:46

问题


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

来源:https://stackoverflow.com/questions/5969387/multiple-consumers-per-streamingamf-connection

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!