Reputation: 627
I've started to learn Reactive paradigm, so I'm pretty new in this topic. I created a sample app which uses Spring R2DBC to connect to PostgreSQL DB.
I created a Rest Controller for fetching and saving data in DB to better understand a concept.
I expected to meet the following scenario:
Unfortunately it does not work in such way. Basically point no (3) is never happening and I need to fire query from (1) manually to hit the DB again.
My question is - am I doing something wrong or understanding reactive database concept incorrectly?
I feel, needing some explanation here. I really appreciate your help at this issue.
Upvotes: 2
Views: 705
Reputation: 9321
Genrally,I think http connection and database connection will release the connection after execution is done.
But for your cases list here, it is not diffcult to implement in Spring Reactive stack.
I have created some samples using a tailable Mongo document.
For R2dbc, you can use Sinks
or Processors
to replay the payload (when it is saved) and sent to the client, check this branch.
And you can also ultilze Postgres Notificaiton to implement similar featuers, check this question.
Upvotes: 1