Atmosphere appends to response instead of sending a new one.
Hello, so I've managed to fix some of my problems described earlier
(http://java.net/projects/atmosphere/lists/users/archive/2011-09/messag e/1) and get jQuery Atmosphere plugin partly working in IE by adding to
web.xml the following:
Curiously, when I remove useStream, the problem with message caching
This, however, leads to another 'interesting' behavior. I need to
multiplex my connection so I'm using jfarcand's solution of appending
data to the response and dispatching it to the proper widget on the
client-side. Whenever I try do do:
in my handler, I get:
with no stack trace and of course the response the client receives is
empty (except for the filler junk).
It doesn't matter whether I actually subscribe using streaming, all
that's required is this init-param.
As soon as I remove it, apart from the usual IE problem, another issue
surfaces. The data gets written to the response, but when it's received
means all the previous callbacks are being called! So first publish
works fine, the second calls first and second and so on...
I've tried various combinations of init-params, read through all the
mailing list, even found someone with a similar case but no solution.
Has anyone encountered such problems and could provide assistance?
Thank you in advance
Re: Atmosphere appends to response instead of sending a new one.
seems to me like a problem with the "X-Cache-Date" header parameter. In the last couple of days I was loosing my mind over something very similar. If the client and server are badly out of sync (if the client is more than 5 minutes behind of the servers time), this is what org.atmosphere.cache.HeaderBroadcasterCache does... it returns all of the cached messages. First thing you can do is remove the following init-params from the web.xml to see whether this is the problem:
Hi, thank you for your response. Unfortunately, my problem is a bit
different. Removing the BroadcasterCache apparently changes absolutely
nothing for me. The thing that makes the difference is 'useStream'.
Moreover, on my development machine there is no time difference between
client and server as they both run on my computer.
Re: Re: Atmosphere appends to response instead of sending a new one.
sorry I couldn't help, it was worth a try.:) Maybe just one more thing to consider... From my experience a lot of strange behaviour can be prevented using the right server. Currently I am using Jetty-7.5.0.v20110901, GlassFish and some other versions of Jetty gave me a lot of headaches.:)
I really appreciate your input and give it serious consideration. I'm
actually trying to move away from Jetty and try Tomcat instead. Jetty
is only our dev environment and as such a low priority target. This
also causes a lot of problems, but fortunately at the moment they are
different than before (unless they will resurface later). Hopefully
reliability will be a priority in the next release.