I have an apache geode setup. I have connected geode with external datasource which is postgres. There is a scenario where i have few data present in apache geode and rest all is in postgres. I am using query service to fetch data and when i fire query then i want that apache geode should provide me data present in its server and from postgres as well(for data not present in apache geode ). How can i proceed with that?
I have my cache loaded which loads data if it is not present in Apache Geode.
''' @Service public class QuoteLoader implements CacheLoader<String, Employee> {
private static Logger logger = LoggerFactory.getLogger(QuoteLoader.class);
@Autowired
EmployeeImpl employeeImpl;
@Autowired
EmployeeRepository employeeRepository;
public QuoteLoader() {
}
@Override
public void init(Properties props) {
}
@Override
public void close() {
}
@Override
public Employee load(LoaderHelper<String, Employee> helper) throws CacheLoaderException {
Employee value = null;
try {
value = employeeImpl.getEmployeeById(Long.valueOf(helper.getKey()));
} catch (Exception e) {
e.printStackTrace();
logger.error("Error Occured", e);
}
return value;
}
} '''