Hazelcast not injecting spring dependencies

511 views Asked by At

I'm using hazelcast 3.8.5 as the store for jcache.

It appears hazelcast is not injecting SpringAware dependencies into the CacheLoader.

I took a peek at AbstractCacheRecordStore and it seems like only Hazelcast InstanceAware dependencies are injected, not SpringAware + Autowired

I'm setting up the cluster managedContext programatically like: config.setManagedContext(springManagedContext);

Update

A work around I've found is put the ApplicationContext into the UserContext of hazelcast. Make the CacheLoader implement HazelcastInstanceAware. Pull the context out of there and finish autowiring the CacheLoader. Not ideal, but it works.

1

There are 1 answers

1
Pschmeltz On BEST ANSWER

Created https://github.com/hazelcast/hazelcast/issues/11384 Only work around is getting spring app context out of hazelcast user context.