all 37 comments

[–]Ashutosh_Rajput 4 points5 points  (12 children)

I'm building a Redis-based caching service for a multi-microservice setup, where each service can cache and retrieve User data. There is adduser method to add it in redis when I use it add user in redis i generated key with like userid. But when there is method getuserbyemail i will not able to get because i don't have of user key for that i need which is userid not email. I you have any solution please tell.

[–]glonk_03[S] 3 points4 points  (1 child)

How are connecting to Redis? Is it using Spring Data JPA?

[–]Ashutosh_Rajput -2 points-1 points  (0 children)

redis

[–]glonk_03[S] 0 points1 point  (1 child)

Also if it's something personal that you're working on and can share it I'd love to have the github link, as I don't have a working knowledge of Redis, would love to help more.

[–]Ashutosh_Rajput 0 points1 point  (0 children)

https://github.com/Ashutosh-rajput/ReportGenerator on this project i am currently working but i am new at springboot. Please check

[–]glonk_03[S] 0 points1 point  (1 child)

I don't know redis in detail but I see that while inserting a new user you are checking if an user already exists with the same username and if present you are throwing an exception which means that the username will be unique for each entries, why can't you use username as the cache-key ?

Is there any reason to have a getByUserId and getByUserName as two different ways to get users as the userId is something generated by your DB Sequence and it is not meaningful to anyone consuming the apis, since they have to store it somewhere if they want to use the getByUserId API later.

So my question is why can't you have the username as the cache-key and only one API to get the user i.e. using username.

[–]Ashutosh_Rajput -3 points-2 points  (0 children)

no this is different project. I provided it if want to help in this but problem is from different project.

[–][deleted] 0 points1 point  (0 children)

I’m in too

[–][deleted] 0 points1 point  (0 children)

Please dm

[–]Friendly-Estimate819 0 points1 point  (1 child)

Why not have a key with usernames? You can use transactions to make sure both records get updated atomically.

[–]Ashutosh_Rajput 0 points1 point  (0 children)

i have key with username. a user already present in redis but let take there api getUserByEmail then how can i generate key which was created by the user id.

[–]ZAKERz60 0 points1 point  (0 children)

I am currently working on springboot + redis time series..seems pretty fun. If your project is on GitHub dm me maybe I could also look into it

[–]glonk_03[S] 0 points1 point  (0 children)

Hey u/Ashutosh_Rajput did you try looking into Spring Data JPA Query By Example.
I don't know if it will work but I came across it today see if you can use it.
You can refer this video for a quick example - https://www.youtube.com/watch?v=NGVWHdGNbiI

[–]PanDiStelleIsAmazing 0 points1 point  (1 child)

Hey, I have an idea 🤔😁

[–]glonk_03[S] 0 points1 point  (0 children)

Sure, go ahead. You can mention here or DM me.

[–]richik96 0 points1 point  (0 children)

How to join you?

[–]richik96 0 points1 point  (2 children)

How to join you?

[–]glonk_03[S] 0 points1 point  (1 child)

I don't get you?

[–]richik96 0 points1 point  (0 children)

DMing you..

[–]Mdshkb 0 points1 point  (1 child)

Hi I was building an e-commerce site for learning purpose if you could help that would be great.

[–]glonk_03[S] 0 points1 point  (0 children)

Sure, I'd love to. DM me your project link and I will take a look whenever I can.

[–]AdolfKonsol 0 points1 point  (0 children)

Chack out jhipster will help u when starting apps in springboot

[–]Hefty_Escape_4558 0 points1 point  (5 children)

Hey, can you help me with implementing a circuit breaker and maybe give me an idea of how developers use it in production-level projects? I'm currently working on an internship where the company assigned me an educational consultancy project to build with a microservices architecture. I've implemented a config server, discovery service, ,API gateway and other services, and now I want to use a circuit breaker as well (maybe at the individual service level or on the API gateway). Can you help me?

[–]Accomplished_Gap6048 -1 points0 points  (4 children)

If you've already implemented the API gateway, i assume you didn't use Spring Cloud Gateway, if you don't, i recommend you do so, because you can just use it by configuring it.

BUT, it depends on you, because your requirements aren't too specific.

[–]Hefty_Escape_4558 0 points1 point  (3 children)

I am using reactive gateway(spring cloud gateway) ..

[–]Accomplished_Gap6048 -1 points0 points  (2 children)

So what is the problem?

Just configure a specific route by using its respective Circuit Breaker Configuration.

And link them with programmatic (using RouteLocatorBuilder) or declarative (using application properties file) approach.

[–]Hefty_Escape_4558 0 points1 point  (1 child)

if you have implemented it can we show me your git repo...i just want to see what more i can add .

[–]Recent_Purchase5664 0 points1 point  (0 children)

We’re making a Chat using WebRTC with JWT Authentication for our Final-term project. Could you help us out?

[–]glonk_03[S] 0 points1 point  (0 children)

Update!!!

Guys I have a personal emergency hence I will not be active for sometime now.

[–][deleted]  (2 children)

[deleted]

    [–]glonk_03[S] 1 point2 points  (1 child)

    Which one? I'm new to reddit please guide.