DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • Efficient Sharing Data in Ansible
  • Implementing API Design First in .NET for Efficient Development, Testing, and CI/CD
  • Build a Simple REST API Using Python Flask and SQLite (With Tests)
  • How to Create a Successful API Ecosystem

Trending

  • Developers Beware: Slopsquatting and Vibe Coding Can Increase Risk of AI-Powered Attacks
  • How Can Developers Drive Innovation by Combining IoT and AI?
  • How to Build Real-Time BI Systems: Architecture, Code, and Best Practices
  • Customer 360: Fraud Detection in Fintech With PySpark and ML
  1. DZone
  2. Data Engineering
  3. Databases
  4. Redis Users Rejoice! The JCache API Is Here

Redis Users Rejoice! The JCache API Is Here

If you've been waiting for Redisson's JCache API implementation, then wait no more.

By 
Nikita Koksharov user avatar
Nikita Koksharov
·
Updated Jan. 06, 17 · News
Likes (7)
Comment
Save
Tweet
Share
36.7K Views

Join the DZone community and get the full member experience.

Join For Free

The JCache API implementation for Redis has been expected by Java community since its publication. Finally, the day has come. The Redisson team now proudly presents to you our JCache API (JSR-107) implementation for Redis, an implementation based on the Redisson framework.

Let's get started with a few configuration examples. Redisson supports two configuration formats — JSON and YAML. If a configuration instance is not defined at runtime, then Redisson will look for /redisson-jcache.json or /redisson-jcache.yaml in the classpath.

MutableConfiguration<String, String> config = new MutableConfiguration<>();

CacheManager manager = Caching.getCachingProvider().getCacheManager();
Cache<String, String> cache = manager.createCache("namedCache", config);

The configuration can be defined manually and loaded from literally anywhere, thanks to the URI object.

MutableConfiguration<String, String> config = new MutableConfiguration<>();

// json config
URI redissonConfigUri = getClass().getResource("redisson-jcache.json").toURI();
// or yaml config
URI redissonConfigUri = getClass().getResource("redisson-jcache.yaml").toURI();

CacheManager manager = Caching.getCachingProvider().getCacheManager(redissonConfigUri, null);
Cache<String, String> cache = manager.createCache("namedCache", config);


It's also worth mentioning that Redisson supports all available Redis configurations:

AWS Elasticache Replication

Automatic Redis master node change discovery.
Config file examples

AWS Elasticache Cluster

Automatic Redis master nodes change discovery
Automatic Redis (master/slave) nodes topology discovery/update
Automatic Redis cluster slots change discovery
Config file examples

Cluster

Automatic Redis master nodes change discovery
Automatic Redis (master/slave) nodes topology discovery/update
Automatic Redis cluster slots change discovery
Config files examples

Sentinel

Automatic Redis master node change discovery
Automatic Redis (master/slave/sentinel) nodes topology discovery/update
Config file examples

Master/Slave

Config file examples

Single

Config file examples

Data Serialization

Data serialization has always been an important part of any framework that works with Redis. Redisson has provided a few good data codecs to choose from:

  1. Jackson JSON
  2. Avro
  3. Smile
  4. CBOR
  5. MsgPack
  6. Kryo
  7. FST
  8. LZ4
  9. Snappy
  10. JDK Serialization

Conclusions

If you one of those who has been waiting for Redis based JCache API (JSR-107) implementation, then wait no more. Enjoy Redisson!

API Redis (company)

Opinions expressed by DZone contributors are their own.

Related

  • Efficient Sharing Data in Ansible
  • Implementing API Design First in .NET for Efficient Development, Testing, and CI/CD
  • Build a Simple REST API Using Python Flask and SQLite (With Tests)
  • How to Create a Successful API Ecosystem

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!