-
1. Re: cleaning up server side callback handlers
timfox Dec 12, 2005 10:50 AM (in response to tom.elrod)Looks like we forget to respond to this one, sorry :(
Just to clarify what we'd like.
We's liket an ability to install an exception listener, but on the server side.
Currently we can do this on the client side, but not on the server side.
We don't want remoting to clean anything up automatically, we just want it to inform us when it finds the connection is broken so that we can do our own cleanup.
From the server side we currently don't know the connection is broken until we try and send on it.
Imgaine the case where a JMS connection has died, but no messages are being sent on it.
Since no messages are being sent, we get no exceptions so we don't know the connection is dead. Therefore it sits around potentially for ever with all the associated application level resources it has allocated.
I guess this would require some kind of ping to impement.
When discussed some time ago, you suggested implementing a kind of "lease" on the ping so if clients didn't ping within a certain amount of time, remoting would consider it broken and call our exception handler.
Just to clarify, we don't want remoting to do any cleanup automatically, simply to call a server side exception handler so we can do this.
I agree, what to cleanup is an application level issue, and varies from app to app.
HTH
Tim -
2. Re: cleaning up server side callback handlers
timfox Dec 19, 2005 12:04 PM (in response to tom.elrod)Tom-
Do you need any more information on this, or are you good to go?
Thx -
3. Re: cleaning up server side callback handlers
tom.elrod Jan 4, 2006 10:17 AM (in response to tom.elrod)Am good for now. Thanks.
-
4. Re: cleaning up server side callback handlers
timfox Feb 3, 2006 10:34 AM (in response to tom.elrod)Tom-
The server side connection listeners don't appear to be working.
I am registering a ConnectionListener with the Connector, then later on a Client instance for the connection either disconnects or the client process dies, but my ConnectionListener doesn't get invoked in either case.
I have sent you a test case to demonstrate this.
Perhaps I am doing something wrong? -
5. Re: cleaning up server side callback handlers
tom.elrod Feb 3, 2006 4:38 PM (in response to tom.elrod)Ok. So a few thing with the test case. First, must explicitly set the lease period and add a connection listener for leasing to be triggered. So would need:
serverConnector.setLeasePeriod(1000);
serverConnector.addConnectionListener(new SimpleConnectionListener());
Second, since the server and client are in same VM, when the connect() is called on the Client class, it ask the client invoker if is already connected. Since is local, will always say that it is connected. This causes the initial request by the client to setup the lease to be by-passed. Therefore, the lease won't even be started on the server side until the first invocation from the client to the server is made. Even worse, after this first invocation is made and the server sets up its lease for the client, the client will NOT be sending a lease renewal because it was never started up (since the connect() call by-passed this).
So I have created a jira issue for this (JBREM-313). Although not working locally, should work if remote. -
6. Re: cleaning up server side callback handlers
tom.elrod Feb 3, 2006 10:56 PM (in response to tom.elrod)Is fixed now for local case.
-
7. Re: cleaning up server side callback handlers
timfox Feb 4, 2006 5:03 AM (in response to tom.elrod)The test was adding a connectionlistener, it just wasn't setting a leasePeriod.
I (wrongly) assumed this was defaulted and setLeasePeriod was only used to set it to some other value than the default.
After setting the leasePeriod it seems to work.