Closed GoogleCodeExporter closed 8 years ago
Hi,
the problem is the static number "1" which you are using as the client id. The
client id should be the session id (HttpServletRequest#getSession()#getId())
because the listener was registered to the client / session id with
RemoteEventService#addListener(...). As an alternative you could extend from
RemoteEventServiceServlet because these methods doesn't require a client id as
a parameter.
Your english is good. :-)
Regards
Original comment by sven.strohschein@googlemail.com
on 8 Jul 2010 at 9:09
Thank you very match for answer! But I don't have client id when push event and
i think i do not need it, because I must broadcast messages to all clients.
Messages(Events) come to servlet from another service(RMI in my place) and in
this threads I don't have http session, that why I use static "1". I also try
to extends from RemoteEventServiceServlet, but in this case events do not come
to clients 99% this is my mistake :)(maybe wrong sevlet mapping). I see sources
of RemoteEventServiceServlet - it use current session to receive
EventExecutorService. In my place, I think, no difference which way to use - in
both thread do not have session. At this time I use domains as filters :), I
think this is hack(maybe domains do not destroyed even after no clients
subscribed to it - this is potential memory leak), but it works fine for me.
Original comment by vladimir...@gmail.com
on 9 Jul 2010 at 9:05
Sorry, you are right! It is possible to add events to a domain without a client
id. The client id is only necessary for user-specific events and to register
EventFilters. But your scenario should be working because the EventFilter is
registered from the client side (with the right client id). When the event is
added to the domain on the server side, the EventFilters of all registered
clients of this domain will be processed.
I have built a small test scenario with HelloGWTEventService (patch attached).
The EventFilter filters every second event, so the server generated message
events are delivered every 10 seconds instead of every 5 seconds. I have done
everything like in your code snipped above. Could you please compare my changes
with your code? Maybe something of your MessageEventFilter is wrong. Or could
it be that the events are sent before the Listener and EventFilter is
registered? Or are you changing the EventFilter at the server side?
The registration of EventFilters require the client id because EventFilters are
domain and user-specific. But that shouldn't be a problem in your scenario. We
are currently working on additional pure domain-specific EventFilters (required
for multiple session support).
There isn't a memory leak when you are using domains but it's not the cleanest
way. ;-) The domains get removed when the last client is removed from the
domain. The clients are removed when the listener is removed or automatically
when a timeout occurs.
Original comment by sven.strohschein@googlemail.com
on 10 Jul 2010 at 9:27
Attachments:
Original issue reported on code.google.com by
vladimir...@gmail.com
on 8 Jul 2010 at 6:13