• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Over-Engineering Spring Boot Redis component? I just need to get a value from a particular key.

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a Spring Boot application and I am adding a Redis component to it. I'm fairly new to Spring Boot and very new to Redis. What I need to do is get a JSON String from a Redis server and then the application will do some manipulations/handle that String. Basically I just need the Read of a CRUD setup. A different application manages the contents of the Key/Value, this application just needs to make sure it is using the most updated Value from time to time before it does stuff.

All of the tutorials I'm finding suggest to make a Redis Configuration and Repository. Something like this:





The tutorials I've been looking at (like this one: https://grokonez.com/spring-framework/spring-data/spring-data-redis-example-spring-boot-redis-example) suggest that to get the value of a particular key you'd do something like this:


But I don't have a DataModel I'm directly trying to turn my find call into. I just want a String value associated with a particular Key. So, I'm thinking that I need to change in the Configuration and Repository to because I'm using a String to get a String?

I'm also not really using hash functionality like in the examples where there are different ids as part of the Key. I just need a way to get/find a Key's value, something more like a JedisPool? Along the pseudo-code of:


But I'm not sure how to set that up within what I'm already working with. Or maybe my overall approach is way off? Appreciate any help! Thanks.
 
Hans Hovan
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I figured out my need:

Used

and then



to get the String value I was looking for.
 
Whatever. Here's a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic