简体   繁体   English

Gemfire异常处理

[英]Gemfire Exception handling

I have a Local Cache which is caching data from a web service. 我有一个本地缓存,用于缓存Web服务中的数据。 If suppose the web service is down, then definitely there is an exception thrown. 如果假设Web服务已关闭,则肯定会引发异常。 I would like to handle this exception and return previously cached values from the method. 我想处理此异常并从该方法返回以前缓存的值。 Can any one tell me, Does Gemfire has any such exception handling feature to handle such exceptions? 谁能告诉我,Gemfire是否具有任何此类异常处理功能来处理此类异常? Im using annotation based caching. 我正在使用基于注释的缓存。

I'm assuming you are referring to the Spring @Cacheable capability. 我假设您指的是Spring @Cacheable功能。 With that framework, the cache is checked first so, if there is an answer in the cache it will not call the web service at all (so it won't matter whether it is up or down). 在该框架下,首先检查缓存,因此,如果缓存中有答案,它将根本不会调用Web服务(因此,启动还是关闭都无关紧要)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM