Comments (3)
Hi, any update or observation on this?
from spring-boot-data-geode.
Hi @ranishwetha -
Alright, where to begin?
- First, you state...
In my application, I don't need client cache either. Is there a way to avoid using this?
What do you mean by, "I do not need a ClientCache
?"
Why would you use Spring Boot for Pivotal GemFire (SBDG) in the first place if you did not need a ClientCache
(?), where it would seem you are deploying your Spring Boot app to PCF and using PCC (??). In order to connect to a PCC cluster in PCF, you need a ClientCache
instance. If you have defined GemFire objects (e.g. Regions) in your application configuration to manage your data, then those objects require a cache instance.
It would also seem your are using PCC as a "caching provider" / backing store for the implied use of Spring's Cache Abstraction in your application given the declaration of the @EnableGemfireCaching
annotation.
Given the above, this is why you getting the follow error message by Spring Boot on startup:
Consider defining a bean named 'gemfireCache' in your configuration
- Second, when using Spring Boot for Pivotal GemFire (SBDG), you do not need to "explicitly" annotate your application configuration class (i.e.
GemFireConfiguration
) with any of:@ClientCacheApplication
,@EnableGemfireCaching
,@EnablePdx
nor@EnableSecurity
since, OOTB, SBDG provides auto-configuration for all of these features.
SBDG provides you with a ClientCache
instance, by default. It also enables PDX, by default. It can detect the context in which your app is deployed/running (e.g. PCF when using PCC) and automatically apply the necessary/required Security settings, by default. And, when either Apache Geode or Pivotal GemFire is on your application's classpath, then SBDG will automatically use GemFire or Geode as a "caching provider" in Spring's Cache Abstraction, by default.
You typically do not declare any of the SDG's 3 cache type annotations [@ClientCacheApplication
, @PeerCacheApplication
, @CacheServerApplication
] when using SBDG unless you want to A) override the cache type (again, a ClientCache
by default) to use another type of cache (e.g. a "peer" cache instance when you want your application to be "peer" member of the GemFire/PCC cluster, which is rare) or B) you want to supply custom, very-specific cache configuration (e.g. subscriptionEnabled = true
on the client).
Of course, there are other ways to accomplish the later (B), i.e. supplying additional, custom cache configuration, either by way of Properties or using a Configurer bean.
To get these "default" features out of the box, you simply only need to declare org.springframework.geode:spring-gemfire-starter
in your application dependencies, thereby adding the LIB to your application's classpath at runtime.
- Third, you do not need to specifically annotate your application configuration class with
@Configuration
either, since the@ClientCacheApplication
annotation, or even Spring Boot's@SpringBootApplication
annotation is already (indirectly) meta-annotated with@Configuration
. For instance.
The only annotations you need in your case to get started, really, is...
@SpringBootApplication
class MySpringBootApplication { .. }
... again, providing the org.springframework.geode:spring-gemfire-starter
dependency (LIB) is on your application's classpath at runtime.
Done!
- Finally, as for logging...
Neither the @ClientCacheApplication
annotation, nor SDG in general, prevent you from customizing the logging for a GemFire client or server itself.
Under the hood, Pivotal GemFire/PCC (and by extension, Apache Geode) uses the Log4j framework as its logging facade and implementation. Therefore, you can supply the logging configuration for a GemFire/PCC app by following the documentation.
The @ClientCacheApplication
annotation simply gives you the ability to affect the logLevel
.
And, since you do not explicitly need to specify the @ClientCacheApplication
annotation in a SBDG application, and thus have no direct way to set logLevel
by way of the @ClientCacheApplication
annotation logLevel
attribute, SDG provides the @EnableLogging
annotation, which implies this setup.
Either way, it seems in your case, you should be following the "advice" in the opening paragraphs, here.
Hope this helps!
Regards,
@jxblum
from spring-boot-data-geode.
Thanks John! This is helpful.
from spring-boot-data-geode.
Related Issues (20)
- Create a spring-cloud-bindings BindingsPropertiesProcessor for Apache Geode HOT 2
- State project goals in documentation
- Include chapter on Testing in the SBDG reference documentation
- Compatability matrix is not up to date. HOT 1
- Remove link to SDG Version Compatibility Matrix in SBDG Wiki
- Missing geode-pulse Dependency in Documentation
- Compatibility question HOT 3
- Using a sealed class as a data object fails HOT 1
- Inheriting from entity types causes failure when using entity-defined Regions HOT 1
- Exception thrown when parsing spring.session.timeout property with java.time.Duration styling HOT 1
- Improve documentation around overriding dependency versions
- Clarify the use of SDG's @EnableExpiration annotation in docs
- Integrate Apache Geode and Jetty 11 HOT 1
- Improve Logging configuration in the Starter
- @LocatorApplication does not work with @EnableSecurity HOT 5
- PARTITION_PERSISTENT_OVERFLOW index slow HOT 6
- SBDG Fails in Docker HOT 10
- Gemfire Fails in AWS ECS HOT 8
- Add new BeanPostProcessor to register RegionConfigurers for explicitly declared Region beans
- Improve logging output for @EnableClusterAware functionality re:connection type HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-boot-data-geode.