Comments (4)
So I am sure to properly understand the question, are you refering to this type of caching ?
https://springhow.com/spring-boot-redis-cache/
from candid-cqrs.
first apologize for my late reply.
yes but only on requests, because the commands do not need is it possible
and do not pollute the domain as in example https://springhow.com/spring-boot-redis-cache/
and create a cahe decorator for all requests thank you
from candid-cqrs.
You could do something like as described in this PR
This is a "proof of concept" pull request only.
But if you run the application with ./gradlew clean bootRun
you should see it working.
It shows how one could theoritically use a single middleware to enable spring @Cacheable
features for all incoming queries.
WARNING
- As it is here, there is no time expiration for the cache. This need to be configured at the cache provider level as explained here. I will leave it to you to configure the REDIS.
- Also, I suspect you need to be disciplined and always override
hashCode()
andequals()
on your Query objects if you want to avoid any colision issues with this. Use it at your own risks.
Another way to do it, should you want something more fine grained, would be to use @Cacheable
directly on your CommandHandlers and QueryHandlers, the same way you would do with a traditional Spring service. The ones on your Command handlers would evict the cache and the ones on your query handlers register the result in the cache.
from candid-cqrs.
thank you for your help I will be inspired by this to do it with redis
from candid-cqrs.
Related Issues (7)
- How to implement jwt authentication inside the command and query buses ? HOT 5
- communication between bounded context HOT 1
- Domain and ManyToMany relationships HOT 2
- Provide a middleware to store DomainEvents (For read side)
- Allow some domain events to be processed within the current transaction and others to be processed after
- Store some DomainEvents before processing them (side effects)
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 candid-cqrs.