Cloud Native Java by Josh Long

Cloud Native Java by Josh Long

Author:Josh Long
Language: eng
Format: epub
Publisher: O'Reilly Media
Published: 2017-08-17T04:00:00+00:00


Evicts the User record with the supplied ID from the Redis cache.

Gets a cached record from Redis or puts a User record from MySQL into the Redis cache.

Evicts a User record and replaces it with the newly updated User record.

Evicts the User record with the supplied ID from the Redis cache.

In Example 9-34, we have our UserService class, which is responsible for performing cache operations as well as managing database records for the User entity class in MySQL. This service is using annotation-driven caching to manage the life cycle of a replicated record in Redis. The four CRUD operations in this class are fairly simple. The primary key from the User record is being used as the generated key for the cache manager provided for Redis. The caching annotations are using Spring Expression Language (SpEL) to access the key from the parameters of the methods.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.