How to make custom cache for spring cloud config server - spring-boot

Spring cloud config server caches files in tmp directory.
How can one implement own storage, hence hashmap, hazelcast cache or local db instead of file system?

Related

Is there bootstrap file in Quarkus application ? I can read external config files using spring cloud config server client

I can read external config files using spring cloud config server client at runtime, but before the application startup I can't not. I can't use external config files for like database connection or kafka topic. Does anyone know something?
Spring has a file like bootstrap is used before starting application and retrieve all of configurations. But Quarkus client does not do that, It retrieve the properties after application status ready
You can use quarkus.config.locations to load external files from any location: classpath, folder, HTTP, etc (just needs to be a valid URI).
Please check: https://quarkus.io/guides/config-reference#quarkus-config-config_quarkus.config.locations

when spring cloud config server calls the github repository?

I mean spring cloud config server fetches all client api's configuration during startup ?
or
spring cloud config server fetch the client API configuration, when that client api calls the config server?
That behaviour is controllable via a property:
spring.cloud.config.server.git.clone-on-start
Flag to indicate that the repository should be cloned on startup (not on demand). Generally leads to slower startup but faster first query.
Default:
false
So the default behaviour is that the repo will only be cloned when a client first makes a request to the server, but if you set the property to true, then the server will clone the repository when it starts and the configuration will be available to the client's first request faster

Difference between spring cloud config server vs consul?

I am confused when to use spring cloud config server and consul.
Both will read configurations files in their own ways.
Can you please let me know when use spring cloud config server and when to use consul?
Both serve configuration from remote servers to spring boot applications. Config Server aggregates configuration from multiple sources: git, svn, sql databases, vault and credhub. Spring Cloud Consul serves configuration to boot apps directly from the consul key-value store. If you already have consul in your infrastructure, it would simplify things by not having to run config server.

How to use EhCache (local) and RedisCache (remote) in the same spring boot project?

I have a spring boot project that need local and remote caching. I am trying to use ehcache for local and Redis for remote, but I can't configure both to work together.
I am also trying to use PubSub as Redis Caching, because this one will be seen by others computers.
At this moment, Redis is storing all caching instead of just what I want to.

Using Spring cloud config in multi application architecture

I am currently using Spring external configuration by creating a config server, config client and a Git repository with property files. Is there any way to use this config server for multiple applications?
My Current Architecture:
Created a Git repository with config files.
Created a Config Server which connects to the above Git repository for property files.
Created a Client (Spring boot application) which connects to the config server to load the properties.
When there is a change in any of the property files, I am invoking the refresh method of config client to refresh the properties. If there are multiple applications using the same config server and git repository for property files, what should be the approach to refresh all the properties without invoking the /refresh method of all the applications?
I tried /refresh of the config server but it doesn't refresh the properties as they are loaded during the application startup.

Resources