Hello, I begin to think different... life cycle of CacheStore and life cycle of Service may be absolutely different.
Service can be undeploy (like this ignite.services().cancel(CacheStoreBackend.SERVICE_NAME)), when cache (with store) continue existing. In that case, I think, get service just in time, when it needed, is a best way. Try to suggest this on dev list ([email protected]) before. On Thu, Sep 15, 2016 at 3:23 PM, Evgeniy Ignatiev < [email protected]> wrote: > I am going to file issue, also there is one point I want to clarify before > doing this: having already configured and run cluster, upon deployments to > a newly joined node, services and caches are started independently, and > creation of a cache store for a cache may occur before all of the services > intended to be injected are deployed, this will result in the same behavior > as in the example I provided. Should I include this case into the issue? > > > On 9/15/2016 2:52 PM, vdpyatkov wrote: > >> I think, you are right. >> Could you plese create issue for Ignite in Apache Jira[1]? >> >> Until you can to use something like this: >> >> Ignite ig = Ignition.ignite(); >> backend = ig.services().service(CacheStoreBackend.SERVICE_NAME); >> >> as workaround. >> >> [1]: https://issues.apache.org/jira/secure/Dashboard.jspa >> >> >> YevIgn wrote >> >>> Hello, everyone. >>> >>> Recently, while using service injection in custom CacheStore >>> implementation, we faced the problem that with startup deployment of >>> services and caches through Spring, the services are not injected into >>> CacheStore. It doesn't happen when we deploy our services and caches >>> manually, so we assume the behavior is not intended. >>> >>> Here is the small demo proejct: >>> https://github.com/YevIgn/ignite-cache-store-service-injection - when >>> running example.Main I get NPE on cache.put(..) >>> >>> Could you, please, look into it and advise on possible resolution of >>> this issue? >>> >> >> >> >> >> -- >> View this message in context: http://apache-ignite-users.705 >> 18.x6.nabble.com/Services-not-injected-into-CacheStore-if- >> deployed-using-Spring-configuration-tp7708p7761.html >> Sent from the Apache Ignite Users mailing list archive at Nabble.com. >> > > -- Vladislav Pyatkov
