-
Notifications
You must be signed in to change notification settings - Fork 0
Example: Stock quotes
Esta Nagy edited this page Feb 11, 2023
·
2 revisions
In this example, we are dealing with the use case when our application allows users to track a watchlist of stocks regularly. As we cannot expect each user to have the same watchlist, we cannot expect that a cache of bulk requests would be very effective. At the same time, we know, that we could easily cache the majority of the stocks we have in our database, so using a single stock based caching can make sense.
The origin service can be found named StockService.
The rest of the Cache-Only integration consists of the following items:
- The code calling the origin service StockBatchServiceCaller
- Please note that the strategy we use is
PESSIMISTIC
and we are only using a batch size of 2 for the sake of using this case as a test
- Please note that the strategy we use is
- StockBatchRequestTransformer handles the splitting and merging of the requests
- StockBatchResponseTransformer does the same for responses
- Caching is configured by StockPartialCacheSupport