Expand my Community achievements bar.

LCDS Streaming fails (AMF Issue) with Multiple Tabs of Browser(IE7 or FF3)

Avatar

Level 1

Hi,

Environment:

IE Version: 7.0.5730.11.CO

Mozilla Firefox Version: 3.0.10

Requirements:

Pushing data to clients using LCDS NIO Streaming AMF Channel. The consumer used on the client side is MultiTopicConsumer having the subtopic and the selection operation set on it.

The client has a Login and a Welcome screen. The subscriptions to the Alerts are done after completing the login process and before opening the Welcome Screen.

Problem statement:

The application is opened in 2 separate tabs of the browser at the same time. The user logs in and goes to the welcome page in both the tabs. Then the user performs some operations the application hangs and after some time it comes back with the below mentioned errors. After that any push only goes to the first opened tab the second tab doesn’t get any of the pushed data.

The fault detail is as below:

The consumer was not able to subscribe to its target destination.

The error as seen in the flashlogs.txt is as given below:

'my-nio-amf-stream' channel got status. (Object)#0

code = "NetConnection.Call.Failed"

description = "HTTP: Failed"

details = "http://localhost:2080/nioamfstream"

level = "error"

'2885C524-D185-7679-9AC1-EC057C9E0085' consumer channel faulted with Channel.Call.Failed NetConnection.Call.Failed: HTTP: Failed

'2885C524-D185-7679-9AC1-EC057C9E0085' consumer fault for '28AC4573-EB7C-CBCE-9EE5-EC057F0F0EF8'.

From the LCDS Debug logs what i can find is that the FlexSession being used is same and that might be causing the problem.

Please help me as to how to make the subscriptions work from multiple tabs of the same browser.

Can someone please help me in this regards?

Thanks in advance for your help.

Please find attach the full flashlog containing the error message.

3 Replies

Avatar

Employee

Hi. It sounds like you are running into max connections per server limits in the browser. IE 7 by default limits you to two persistent connections to a single server. To avoid the problem you are having, you need to configure the server to only allow one streaming connection per session which will force the application in your second tab to failover to another channel (for example polling) when it tries to connect to the server. You can configure these settings per user-agent (or browser) so that users that are running browsers with higher max connections per server limits can open up more streaming connections.

The user-agent settings get added to the configuration for the endpoint in your services-config.xml file.Here is a description of these settings.

<!-- Optional. Default values are as shown. User agents are used to customize
                      a polling endpoint for specific browsers. This setting is ignored if
                      wait-interval-millis is not greater than 0 (i.e. the channel must be
                      a "long-poll" channel). There is a browser specific limit to the number of HTTP
                      connections allowed per session. In Firefox, this value is 8 by default, in IE,
                      it is 2. A single long-poll connection requires two browser HTTP connections in
                      order to send data in both directions. One for the streamed response from the server
                      to the client that the channel hangs on to, and a second transient connection, drawn
                      from the browser pool only when data needs to be sent to the server and this second
                      transient connection is then immediately released back to the browser's connection pool.
                      In order for client applications to function properly, the number of HTTP connections made by all
                      clients running in the same session (keep in mind that clients running in seperate browser
                      windows can share the same HTTP session) needs to stay within the limit established by the
                      browser. The max-streaming-connections-per-session setting is used to limit the
                      number of streaming connections that can be made from clients in the same browser
                      session. By default, the endpoint will use 1 for the max-streaming-connections-per-session
                      value which should not be overwritten for IE. For Firefox this can be set as high as 4, which
                      will allow 4 clients running in the same browser session to have a persistent connection for
                      receiving messages and another connection which can be used for sending messages.
                      The special match string "*" will define a default to be used if no string matches.
                      The match strings "MSIE" and "Firefox" are always defined and must be specified
                      here explicitly to override the default settings, specifying "*" does not do so.
                      If you are using streaming channels, you should configure both the streaming and polling
                      channels to the same values.
                 <user-agent-settings>
                     <user-agent match-on="MSIE" max-streaming-connections-per-session="1"/>
                     <user-agent match-on="Firefox" max-streaming-connections-per-session="1"/>
                     <user-agent match-on="*" max-streaming-connections-per-session="1"/>
                 </user-agent-settings>
                 -->

Hope that helps.

-Alex

Avatar

Level 1

Thanks a lot for the response.

We already have the "user-agent-settings" in services-config.xml that you mentioned. Please find attach the services-config.xml from the project for reference. The problem still exist.

Not sure what other tweaking is needed.

Thanks in advance.

-Rabi

Avatar

Employee

Hi Rabi,

I am facing the similar issue and what i did is i made a change in the parameter of heartbeat of NIO-amf-Streaming. Once i reduced the heartbeat parameter from 10000 to 1000 i am not facing any hang. Please try this and let me know if that works.

<channel-definition id="my-nio-amf-stream" class="mx.messaging.channels.StreamingAMFChannel">
            <endpoint url="http://{server.name}:2080/nioamfstream" class="flex.messaging.endpoints.StreamingNIOAMFEndpoint" />
            <server ref="my-nio-server" />
            <properties>
                <server-to-client-heartbeat-millis>1000</server-to-client-heartbeat-millis>
                <user-agent-settings>
                    <user-agent match-on="MSIE" kickstart-bytes="2048" max-streaming-connections-per-session="5" />
                </user-agent-settings>
                <record-message-times>true</record-message-times>
            </properties>
        </channel-definition>

UKB.