Hi,

I changed listener code and it worked I got cache from completeale future
inside listener:

IgnitePredicate<CacheEvent> locLsnr = new IgnitePredicate<CacheEvent>(){
            @IgniteInstanceResource
            private Ignite ignite;
            @Override
            public boolean apply(CacheEvent evt) {
                System.out.println("Received event [evt=" + evt.name() + "
cacheName=" + evt.cacheName());
                 CompletableFuture<String> fut =
CompleteableFuture.supplyAsync(() -> { IgniteCache<Integer, String> c =
ignite.cache(evt.vacheName()); // not null in here
return "";
};
                System.out.println("finish listener");
                return true;
            }
        };




On Nov 12, 2018 12:31, "Vadym Vasiuk" <[email protected]> wrote:

In other words - there is no way to do something with the cache after event
which signals about its creation.


On Mon, Nov 12, 2018, 11:57 Ilya Kasnacheev <[email protected]
wrote:

> Cross-posting from SO:
>
> As a rule you should not perform cache operations, or most of other
> operations that block or access Ignite internals. Events should be very
> fast and lightweight, meaning that they are executed from inside Ignite
> threads and Ignite internal locks.
>
> Just schedule an operation in a different thread on event arrival.
> Regards,
>
> --
> Ilya Kasnacheev
>
>
> пн, 12 нояб. 2018 г. в 10:17, aealexsandrov <[email protected]>:
>
>> Hi,
>>
>> The cache could be started but possible cluster wasn't activated yet.
>> Could
>> you please provide some information:
>>
>> 1)Did you see warnings or errors in the log?
>> 2)Did you see this issue on normal cluster start or only on client
>> restart?
>>
>> Also, I see that you use it in the class named server config. Could you
>> please also provide the use case of this class?
>>
>> BR,
>> Andrei
>>
>>
>>
>> --
>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>>
>

Reply via email to