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}"
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
AMFChannelwith a consumer, you need to talk to anAMFLongPollingendpoint, in which case yourAMFChannelshould havepollingEnabledset to true. however, I suspect you really wantStreamingAMFChannel, 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 yourservices-config.xmlhas amax-streaming-connections-per-sessionset too low. Normally you would want this set to 1, but for development, that can be painful, so set it higher, and use a seperateservices-config.xmlwith production settings for production.