History | Log In     View a printable version of the current page.  
Issue Details (XML)

Key: BLZ-84
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Assignee: aglosban
Reporter: Steven Toth
Votes: 0
Watchers: 4
Operations

If you were logged in you would be able to see more operations.
BlazeDS

Messaging Channels do not work when port not present in browser URL and forwarded from Apache HTTP to Tomcat

Created: 03/11/08 10:04 PM   Updated: 02/12/09 03:01 AM
Component/s: Documentation
Security Level: Public (All JIRA Users )

Severity: Non Functioning
Reproducibility: Every Time
Discoverability: High
Found in Version: BlazeDS 3.0.0
Milestone: BlazeDS 3.0.1
Affected OS(s): Windows - XP
Steps to Reproduce:
Steps to reproduce:
1. Configured Apache HTTP Server 2.2.4 (Win32) on port 80 using mod_jk/1.2.20 to forward requests for context root "samples" to turnkey Tomcat 6 installation from BlazeDS - Community Edition: 3.0.0.544.

# mod-jk configuration in Apache http.conf
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel error
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %T"
JkMount /samples fx
JkMount /samples/* fx

# workers.properties
worker.list=fx
worker.fx.port=8009
worker.fx.host=localhost
worker.fx.type=ajp13
worker.fx.lbfactor=1
worker.fx.connection_pool_timeout=600
worker.fx.connection_pool_minsize=10
worker.fx.connect_timeout=15000
worker.fx.prepost_timeout=10000

# No configuration of Tomcat is necessary as the turnkey Tomcat ships with a ajp13 Connector already defined on port 8009

2. Open 2 separate IE Browser instances and request dashboard sample with no explicit port in the URL (http://localhost/samples/dashboard/index.html) in each one. Click on the pie chart and only the pie clicked on expands (i.e. the message is not delivered).
  
3. Open 2 separate IE Browser instances and request dashboard sample with directly through Tomcat (http://localhost:8080/samples/dashboard/index.html). Click on the pie chart in one browser also expands the pie chart in the browser (i.e the message is successfully delivered).
Alternatively, open 2 separate IE Browser instances and request dashboard sample [through Apache] with explicit port in the URL (http://localhost:80/samples/dashboard/index.html) in each one. The URL gets rewritten [as http://localhost/samples/dashboard/index.html] in the browser address bar, but clicking on the pie chart expands the pie chart in both browser instances (i.e the message is successfully delivered).

This worked with FDS2. I tested this on the same Apache configuration and Tomcat 5.5 configuration I use with FDS2. I added a separate webapp the uses BlazeDS Community Edition. The FDS2 webapp works without the port explicity specified, the BlazeDS does not.
 
 Actual Results:
No messages delivered over StreamingAMFChannel without port explicity specified when going from Apache to Tomcat over default port (80).
 
 Expected Results:
Messages to be delivered over StreamingAMFChannel without port explicity specified when going from Apache to Tomcat over default port (80).
 
 Workaround (if any):
Change the port to explicitly contain the port [80].
 
 
Language Found: English
Bugbase Id: none
Triaged: Yes
Regression: No
QA Owner: aglosban
Resolved by: peterson
Participants: aglosban, Kenneth Teo, Mete Atamel, peterson, Shazz, Steven Toth and Trevor Baker
Browser: Internet Explorer 7.x
JDK: Sun JDK 5
Application Server: Apache Tomcat 6.x


 All   Comments      Sort Order:
aglosban - [03/18/08 12:41 PM ]
The streaming channels won't work through some proxy servers that buffer the response that is sent back to the client. I did some testing with the jk module and confirmed that the streaming connection wasn't getting setup on the client end because the client never got the response to it's connect request that was sent back from the server. The reason this worked in some cases for the user was probably due to exceeding the connections per server limit in the browser and falling back to polling. I saw this behaviour myself when I was doing testing.

The only real workaround for this is to have a polling channel as a backup so if the streaming channel can't connect fall back to polling. The streaming channel needs to have the connect-timeout-seconds property set, so if we can't connect within the given time limit we will fall back to another channel.

<channel-definition class="mx.messaging.channels.StreamingAMFChannel" id="qa-streaming-amf">
        <endpoint class="flex.messaging.endpoints.StreamingAMFEndpoint" url="http://{server.name}:{server.port}/{context-root}/messagebroker/streaming-amf"></endpoint>
        <properties>
            <server-to-client-heartbeat-millis>500</server-to-client-heartbeat-millis>
            <max-streaming-clients>10</max-streaming-clients>
            <connect-timeout-seconds>5</connect-timeout-seconds>
         </properties>
</channel-definition>

I'm marking this as a doc bug because I think the documentation on the streaming channels needs to get updated to included information on this as it's an issue users are likely to encounter. I also think the samples app should have connect-timeout-seconds set on the streaming amf channel.

Mete Atamel - [03/18/08 01:10 PM ]
You summarized it well. I included some extra information in resources/config/services-config.xml for this with changes 849 and 850 on 3.0.x and trunk branches:

"Note that streaming channels might not work through some proxy servers due to proxy buffering of chunked responses used by streaming channels. Therefore it is a best practice to use a polling channel as a backup for a streaming channel and set connect-timeout-seconds of streaming channel to a reasonable value (eg. 5 secs) so that the streaming channel can fall back to polling channel in a reasonable amount of time."

Mete Atamel - [03/18/08 01:13 PM ]
Mike, could you please make sure my previous comment is included in the docs? Thanks.

aglosban - [03/18/08 02:18 PM ]
Please open to Mike to update the Docs.

Trevor Baker - [03/18/08 03:09 PM ]
To Mike for doc.

Steven Toth - [03/20/08 10:51 AM ]
Since this issue is a result of how the proxy (mod_jk in this instance) is implemented it is not something that can be corrected. Therefore using the Streaming AMF channel is not an option with Apache fronting Tomcat. I would need to expose Tomcat directly or front it with another web server whose connector is more compatible with the Streaming AMF channel. Does this sound correct? Are they any other options I'm overlooking. Thanks.

Mete Atamel - [03/27/08 01:06 PM ]
Streaming AMF/HTTP channels are definitely not an option where there is a proxy between the app server and the client and that proxy buffers chunked HTTP responses. In that case, you would want to fault back to polling as described before.

peterson - [03/28/08 01:39 PM ]
Added the following note tfrom Mete o the FrameMaker source and to the BlazeDS Livedocs:

Some proxy servers buffer messages. When streaming HTTP-based channels (both steaming AMF and HTTP channels) are used through a proxy server that does buffering, messages are not delivered immediately but rather in chunks, which defeats the purpose of streaming channels. In that case, instead of having a semi-working streaming channel, it is a better option to fall back to a polling channel. When you do use streaming channels, use a polling channel as the fallback channel and specify connect-timeout-seconds to something reasonable for your environment (for exampple, five seconds). With a short connect-timeout-seconds value, a streaming channel can detect that there is buffering and it can fall back on the polling channel.

Here's the page in the BlazeDS Livedocs:
http://livedocs.adobe.com/blazeds/1/blazeds_devguide/help.html?content=messaging_framework_4.html

aglosban - [03/28/08 02:14 PM ]
Verified Mike's doc changes.

Kenneth Teo - [07/22/08 07:54 AM ]
I am facing a similar problem with mod_jk and BlazeDS and i did not use a streaming channel but a normal long-polling channel. Got my sys admin to tune the mod_jk and tomcat, but still no improvements. It only works well when the Tomcat is public facing

I get this message on my apache error_log:
Tue Jul 22 18:51:59 2008] [error] [client <ip address>] client denied by server configuration: amfsecure, referer: https://www.somedomain.com/myFlexApp.swf

Can I say that BlazeDS does not work well with a Apache Fronting Tomcat?

I am looking into exposing Tomcat directly but having only one machine makes this tough. Is there anyone who can suggest a better connector if there is one?

Shazz - [02/12/09 03:01 AM ]
I may be wrong but I understood that the "bug" still exist and the workaround is to well set the connect-timeout-seconds in order to switch to the polling mode.

But, in this case, is it impossible to use the AMF streaming mode if an apache server is use as a frontend for security and load balancing ? For production systems is is mandatory to expose the tomcat server ? Or is it a mod_jk issue ?

It looks I paraphrase Kenneth but as I face the same issue I really wonder if I should forget the streaming mechanism as in production, my company deployment "rules" forbid me to expose a Tomcat server.