You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by ryagnik <gi...@git.apache.org> on 2017/03/29 03:17:15 UTC

[GitHub] ignite pull request #1688: IGNITE-2786 : SpringCache doesn't survive client ...

GitHub user ryagnik opened a pull request:

    https://github.com/apache/ignite/pull/1688

    IGNITE-2786 : SpringCache doesn't survive client reconnect

    The fix can be applied as follows with SpringCacheManager -
    
    1) Design was to listen for ignite re connect event
    2) And clear the cache on reconnect
    3) Added logger to log reconnect information 
    
    See the following code below and let us know if this is helpful -
    
    In afterPropertiesSet -
    
    //Handles the reconnect event, on server crashes OR network failure, client
    connects to server and
    // destroy the cache
    IgnitePredicate<DiscoveryEvent> lsnr = iEvt -> {
    U.warn(log,"Received discovery event [iEvt=" + iEvt.name() + ", discovery=" + iEvt.shortDisplay() + ']');
    
    caches.keySet().forEach(key ->
    { ignite.destroyCache(key); caches.remove(key); }
    
    );

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ryagnik/ignite IGNITE-2786

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/ignite/pull/1688.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1688
    
----
commit 9cb6a2cc722989d9e9752aad67f5843d028e07f1
Author: Rishi Yagnik <ry...@pdxinc.com>
Date:   2017-03-29T02:44:21Z

    IGNITE-2786 : Fix Spring Client reconnect issue using reconnect event mechanism.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---