Hello! Just declare the field as transient, and then apply if (f == null) f = initialValue() pattern.
Regards, -- Ilya Kasnacheev чт, 4 мар. 2021 г. в 17:34, mvolkomorov <2201...@gmail.com>: > Hi, guys! > > Is it possible to initialize my property with an injected resource at inner > static class of Ignite Service? > > private static class LocalListener implements > CacheEntryUpdatedListener<CaseKey, Case> { > > @SpringResource(resourceName = "kafkaProducerProperties") > private static Properties kafkaProducerProperties; > > private static KafkaProducer<String, String> kafkaProducer; > > @Override > public void onUpdated(Iterable<CacheEntryEvent<? extends > CaseKey, > ? extends Case>> events) throws CacheEntryListenerException { > for (CacheEntryEvent event : events) { > > I want the kafkaProducer to be initialized with new > KafkaProducer(kafkaProducerProperties) like this: > kafkaProducer = new KafkaProducer<>(kafkaProducerProperties); > > > > > -- > Sent from: http://apache-ignite-users.70518.x6.nabble.com/ >