开发者

BlazeDS Channel connects and disconnects immediately

开发者 https://www.devze.com 2023-04-04 07:25 出处:网络
I am connecting to a BlazeDS server with a simple Flex component that is merely trying to subscribe to realtime data

I am connecting to a BlazeDS server with a simple Flex component that is merely trying to subscribe to realtime data

Here are the Channels and Consumer

    <mx:ChannelSet id="channelSet">
            <mx:AMFChannel url="http://localhost:8080/MyApp/messagebroker/streamingamf/"/>     
    </mx:ChannelSet>        
    <mx:Consumer id="consumer" 
                 destination="feed" 
                 channelSet="{channelSet}"
       开发者_JAVA百科          channelConnect="consumer_channelConnectHandler(event)"
                 channelDisconnect="consumer_channelDisconnectHandler(event)"
                 message="consumer_messageHandler(event.message)"
                 fault="consumer_faultHandler(event)"/>

I am being disconnected right after connecting (both consumer_channelConnectHandler and consumer_channelDisconnectHandler are invoked).

Would you have a clue why?


There's a couple of things to note here:

  • You have a StreamingAMF endpoint configured to an AMFChannel. This is wrong, I suspect you want a StreamingAMFChannel.

  • If you're using an AMFChannel with a consumer, you need to talk to an AMFLongPolling endpoint, in which case your AMFChannel should have pollingEnabled set to true. however, I suspect you really want StreamingAMFChannel, in which case, see point 1.

  • Once you configure StreamingAMFChannel, you can find that you still get immediate disconnections on the client. This occurs when you have multiple connections from the same client (ie., tabs), and your services-config.xml has a max-streaming-connections-per-session set too low. Normally you would want this set to 1, but for development, that can be painful, so set it higher, and use a seperate services-config.xml with production settings for production.

0

精彩评论

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