Re: CacheExceptionHandlerFactory and CacheExceptionHandler

View: New views
2 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: CacheExceptionHandlerFactory and CacheExceptionHandler

by gregluck :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Li

(cc'ing the list)

From an ops point of view the best thing would be to monitor the RMI registry listener port, which you know because you configure it. If it disappears the node is down.

The best way to use ehcache is that the distributed cache saves work. If a node becomes disconnected due to a network issue, the node should still be able to satisfy requests if there is a cache miss. e.g. loading from a database or generating a page for the page cache. 

You can use the RemoteDebugger to see what is going on for investigation.

You can also write some code to inspect the cache peers. Example:

List cachePeers1 = ((RMICacheManagerPeerListener) manager1.getCachePeerListener()).getBoundCachePeers();
        assertEquals(55, cachePeers1.size());
        String[] boundCachePeers1 = ((RMICacheManagerPeerListener) manager1.getCachePeerListener()).listBoundRMICachePeers();
        assertEquals(55, boundCachePeers1.length);
        assertEquals(cachePeers1.size(), boundCachePeers1.length);

        List cachePeers2 = ((RMICacheManagerPeerListener) manager2.getCachePeerListener()).getBoundCachePeers();
        assertEquals(55, cachePeers2.size());
        String[] boundCachePeers2 = ((RMICacheManagerPeerListener) manager2.getCachePeerListener()).listBoundRMICachePeers();
        assertEquals(55, boundCachePeers2.length);
        assertEquals(cachePeers2.size(), boundCachePeers2.length);


        List cachePeers3 = ((RMICacheManagerPeerListener) manager3.getCachePeerListener()).getBoundCachePeers();
        assertEquals(55, cachePeers3.size());
        String[] boundCachePeers3 = ((RMICacheManagerPeerListener) manager3.getCachePeerListener()).listBoundRMICachePeers();
        assertEquals(55, boundCachePeers3.length);
        assertEquals(cachePeers3.size(), boundCachePeers3.length);


On 11/06/2008, at 1:14 AM, Li, Hongzhi wrote:

Hi Greg,
 
Thanks for your response. My code works now. I have other question that is whether CacheExceptionHandler can catch the RMI communication exception. Before I use CacheExceptionHandler, my code throw RMI exceptions for the network problems. After I use CacheExceptionHandler, I cannot see the RMI exceptions anymore. In distributed ehcache environment, how I can know the one of nodes is down or network connection has a problem.
 
Thanks
 
 Hongzhi


From: Greg Luck [gluck@...]
Sent: Monday, June 09, 2008 11:27 PM
To: Li, Hongzhi
Subject: Re: CacheExceptionHandlerFactory and CacheExceptionHandler

Li


On 10/06/2008, at 7:53 AM, Li, Hongzhi wrote:

Hi Greg Luck,

I tried to follow the document (http://ehcache.sourceforge.net/documentation/cache_exception_handlers.html) to develop concrete classes of CacheExceptionHandlerFactory  and CacheExceptionHandler. But my code seems not work. Can you give me a sample code for these abstract class and interface. In ehcache.XML, I need to setup both of CacheExceptionHandlerFactory & CacheExceptionHandler or only CacheExceptionHandlerFactory.


Thanks for your help.

Hongzhi


Regards

Greg Luck

skype: gregrluck
yahoo: gregrluck
mobile: +61 408 061 622




Regards


Greg Luck


skype: gregrluck
yahoo: gregrluck
mobile: +61 408 061 622




-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
ehcache-list mailing list
ehcache-list@...
https://lists.sourceforge.net/lists/listinfo/ehcache-list

Re: CacheExceptionHandlerFactory and CacheExceptionHandler

by Li, Hongzhi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Greg,
 
I tried to use your code to check RMI port. But listBoundRMICachePeers() is not visible. I am not sure whether these code work in your test environment.
 
Thanks
 
Hongzhi


From: Greg Luck [mailto:gluck@...]
Sent: Tuesday, June 10, 2008 7:04 PM
To: Li, Hongzhi
Cc: ehcache-list@...
Subject: Re: CacheExceptionHandlerFactory and CacheExceptionHandler

Li

(cc'ing the list)

From an ops point of view the best thing would be to monitor the RMI registry listener port, which you know because you configure it. If it disappears the node is down.

The best way to use ehcache is that the distributed cache saves work. If a node becomes disconnected due to a network issue, the node should still be able to satisfy requests if there is a cache miss. e.g. loading from a database or generating a page for the page cache. 

You can use the RemoteDebugger to see what is going on for investigation.

You can also write some code to inspect the cache peers. Example:

List cachePeers1 = ((RMICacheManagerPeerListener) manager1.getCachePeerListener()).getBoundCachePeers();
        assertEquals(55, cachePeers1.size());
        String[] boundCachePeers1 = ((RMICacheManagerPeerListener) manager1.getCachePeerListener()).listBoundRMICachePeers();
        assertEquals(55, boundCachePeers1.length);
        assertEquals(cachePeers1.size(), boundCachePeers1.length);

        List cachePeers2 = ((RMICacheManagerPeerListener) manager2.getCachePeerListener()).getBoundCachePeers();
        assertEquals(55, cachePeers2.size());
        String[] boundCachePeers2 = ((RMICacheManagerPeerListener) manager2.getCachePeerListener()).listBoundRMICachePeers();
        assertEquals(55, boundCachePeers2.length);
        assertEquals(cachePeers2.size(), boundCachePeers2.length);


        List cachePeers3 = ((RMICacheManagerPeerListener) manager3.getCachePeerListener()).getBoundCachePeers();
        assertEquals(55, cachePeers3.size());
        String[] boundCachePeers3 = ((RMICacheManagerPeerListener) manager3.getCachePeerListener()).listBoundRMICachePeers();
        assertEquals(55, boundCachePeers3.length);
        assertEquals(cachePeers3.size(), boundCachePeers3.length);


On 11/06/2008, at 1:14 AM, Li, Hongzhi wrote:

Hi Greg,
 
Thanks for your response. My code works now. I have other question that is whether CacheExceptionHandler can catch the RMI communication exception. Before I use CacheExceptionHandler, my code throw RMI exceptions for the network problems. After I use CacheExceptionHandler, I cannot see the RMI exceptions anymore. In distributed ehcache environment, how I can know the one of nodes is down or network connection has a problem.
 
Thanks
 
 Hongzhi


From: Greg Luck [gluck@...]
Sent: Monday, June 09, 2008 11:27 PM
To: Li, Hongzhi
Subject: Re: CacheExceptionHandlerFactory and CacheExceptionHandler

Li


On 10/06/2008, at 7:53 AM, Li, Hongzhi wrote:

Hi Greg Luck,

I tried to follow the document (http://ehcache.sourceforge.net/documentation/cache_exception_handlers.html) to develop concrete classes of CacheExceptionHandlerFactory  and CacheExceptionHandler. But my code seems not work. Can you give me a sample code for these abstract class and interface. In ehcache.XML, I need to setup both of CacheExceptionHandlerFactory & CacheExceptionHandler or only CacheExceptionHandlerFactory.


Thanks for your help.

Hongzhi


Regards

Greg Luck

skype: gregrluck
yahoo: gregrluck
mobile: +61 408 061 622




Regards


Greg Luck


skype: gregrluck
yahoo: gregrluck
mobile: +61 408 061 622




-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
ehcache-list mailing list
ehcache-list@...
https://lists.sourceforge.net/lists/listinfo/ehcache-list
LightInTheBox - Buy quality products at wholesale price